[Mpuls-commits] r3935 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 8 13:27:44 CEST 2010


Author: bh
Date: 2010-10-08 13:27:42 +0200 (Fri, 08 Oct 2010)
New Revision: 3935

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (CaseSearch.get_phases_dates_clause):
Ignore the 'unknown' phase when building the where clause for the
combined date/phase search.  The unknown phase does not have any
associated date fields.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-08 09:58:03 UTC (rev 3934)
+++ base/trunk/ChangeLog	2010-10-08 11:27:42 UTC (rev 3935)
@@ -1,3 +1,10 @@
+2010-10-08  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/lib/search.py (CaseSearch.get_phases_dates_clause):
+	Ignore the 'unknown' phase when building the where clause for the
+	combined date/phase search.  The unknown phase does not have any
+	associated date fields.
+
 2010-10-08  Roland Geider <roland.geider at intevation.de>
 
 	* mpulsweb/lib/renderer.py,

Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2010-10-08 09:58:03 UTC (rev 3934)
+++ base/trunk/mpulsweb/lib/search.py	2010-10-08 11:27:42 UTC (rev 3935)
@@ -384,6 +384,11 @@
             sp = p.getStart()
             ep = p.getEnd()
 
+            if sp.datefield is None or ep.datefield is None:
+                # ignore phases without datefields.  This is usually
+                # only the 'unknown' phase.
+                continue
+
             # if phases is None, it means the phases parameter was
             # omitted altogether and all phases should match.
             if phases is None or int(sp.id) in phases or int(ep.id) in phases:



More information about the Mpuls-commits mailing list