[Mpuls-commits] r136 - in waska/trunk: . waskaweb/controllers waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 4 18:32:17 CEST 2008


Author: teichmann
Date: 2008-09-04 18:32:16 +0200 (Thu, 04 Sep 2008)
New Revision: 136

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/case.py
   waska/trunk/waskaweb/model/phases.py
   waska/trunk/waskaweb/model/phases_factory.py
Log:
Make running phases work.


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-09-04 08:35:22 UTC (rev 135)
+++ waska/trunk/ChangeLog.txt	2008-09-04 16:32:16 UTC (rev 136)
@@ -1,3 +1,10 @@
+2008-09-04  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	* waskaweb/model/phases.py, waskaweb/model/phases_factory.py: Fixed 
+	  typo which prevented 'running' states from working.
+
+	* waskaweb/controllers/case.py: Raises StandardErrors in setPhase() now.
+
 2008-09-04	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Search works now with new phase model

Modified: waska/trunk/waskaweb/controllers/case.py
===================================================================
--- waska/trunk/waskaweb/controllers/case.py	2008-09-04 08:35:22 UTC (rev 135)
+++ waska/trunk/waskaweb/controllers/case.py	2008-09-04 16:32:16 UTC (rev 136)
@@ -729,14 +729,18 @@
                 current_phase = state.getPhase()
 
                 if not phase_neighbors(current_phase, new_phase):
-                    raise Error("Phasen sind nicht benachbart.")
+                    raise StandardError("Phasen sind nicht benachbart.")
 
                 fields = case.getRequiredFields()
                 if not fields.isPhaseComplete(new_phase_symbol):
-                    raise Error("Phase ist nicht komplett.")
+                    raise StandardError("Phase ist nicht komplett.")
 
                 state.setPhase(new_phase)
 
+                case_session = session.get('case')
+                case_session.state = state
+                session.save()
+
                 # After setting the phase. Show print-dialog
                 c.success_for   = SET_PHASE_NOTIFICATION_SUCCESS
                 c.success_text  = SET_PHASE_NOTIFICATION_TEXT_SUCCESS

Modified: waska/trunk/waskaweb/model/phases.py
===================================================================
--- waska/trunk/waskaweb/model/phases.py	2008-09-04 08:35:22 UTC (rev 135)
+++ waska/trunk/waskaweb/model/phases.py	2008-09-04 16:32:16 UTC (rev 136)
@@ -44,7 +44,7 @@
         return phase_neighbors(self.phase, other.phase)
 
     def isRunning(self):
-        self.running
+        return self.running
 
     def getLabel(self):
         return phase_symbol(self.phase)

Modified: waska/trunk/waskaweb/model/phases_factory.py
===================================================================
--- waska/trunk/waskaweb/model/phases_factory.py	2008-09-04 08:35:22 UTC (rev 135)
+++ waska/trunk/waskaweb/model/phases_factory.py	2008-09-04 16:32:16 UTC (rev 136)
@@ -231,7 +231,7 @@
 
         start = Phase(
             p1,
-            p2 == current_phase,
+            p1 == current_phase,
             required_fields.isPhaseComplete(symbol),
             required_fields.getPhaseTime(symbol),
             required_fields.getLinkListForPhase(symbol))



More information about the Mpuls-commits mailing list