[Mpuls-commits] r3942 - base/trunk/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 8 17:10:53 CEST 2010


Author: torsten
Date: 2010-10-08 17:10:52 +0200 (Fri, 08 Oct 2010)
New Revision: 3942

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCase.make_consistent): Issue1259:
Ignore the 'unknown' phase when making the phase consistent


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-10-08 14:47:17 UTC (rev 3941)
+++ base/trunk/mpulsweb/model/case.py	2010-10-08 15:10:52 UTC (rev 3942)
@@ -771,7 +771,13 @@
         curphase = phaseslist.get_current_phase_id()
         data = {}
         for phase in phaseslist:
+
             start, end = phase.getStart(), phase.getEnd()
+            if start.datefield is None or end.datefield is None:
+                # ignore phases without datefields.  This is usually
+                # only the 'unknown' phase.
+                continue
+
             if endphase is not None:
                 if int(start.id) > int(endphase):
                     break
@@ -819,6 +825,7 @@
                                 % item.getIdentifier())
 
         # Set values
+        log.debug(data)
         self.formed_instance.setData(data)
         self.formed_instance.commit()
 



More information about the Mpuls-commits mailing list