[Mpuls-commits] r2673 - wasko/branches/2.0/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 5 18:07:33 CEST 2010


Author: torsten
Date: 2010-05-05 18:07:33 +0200 (Wed, 05 May 2010)
New Revision: 2673

Modified:
   wasko/branches/2.0/mpulsweb/model/phase.py
Log:
* mpulsweb/model/phase.py (PhaseList.get_phase): Return dummy unknown
	phase if the user wants to get phase "-1".


Modified: wasko/branches/2.0/mpulsweb/model/phase.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/phase.py	2010-05-05 15:50:38 UTC (rev 2672)
+++ wasko/branches/2.0/mpulsweb/model/phase.py	2010-05-05 16:07:33 UTC (rev 2673)
@@ -141,6 +141,12 @@
             if id == p.start.id: return p.start
             if id == p.end.id: return p.end
 
+        # Return dummy phase for unknown phase
+        if id == '-1':
+            p = EndPhasePart('-1', None, ['1'], [])
+            p.phase = '-1'
+            return p
+
     def get_path(self, phasepart_id, only_reachable=False):
         '''Returns a list of phaseparts id from start to the given phasepart_id'''
         path = []



More information about the Mpuls-commits mailing list