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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 27 19:57:33 CEST 2010


Author: torsten
Date: 2010-10-27 19:57:32 +0200 (Wed, 27 Oct 2010)
New Revision: 4055

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
Moved check if a check for validity will be performed into the checkValidity
function.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-10-27 17:23:30 UTC (rev 4054)
+++ base/trunk/mpulsweb/model/case.py	2010-10-27 17:57:32 UTC (rev 4055)
@@ -863,9 +863,7 @@
 
     def setPhase(self, phase):
         r = self.getState().setPhase(phase)
-        if g.mpuls_config.is_enabled ('case-module', 'checktags'):
-            log.debug('Checking validity because of phase change')
-            self.checkValidity()
+        self.checkValidity()
         return r
 
     def getState(self):
@@ -912,8 +910,9 @@
                                     caseid=self.id)
         setter = TagSetter(tagconfig)
 
-        log.debug('Tagging case: %s' % self.id)
-        setter.perform(self.id)
+        if g.mpuls_config.is_enabled ('case-module', 'checktags'):
+            log.debug('Tagging case: %s' % self.id)
+            setter.perform(self.id)
 
     def getValidity(self):
         '''Will return the id of the max validity based on set tags'''
@@ -1136,7 +1135,9 @@
         if init == True:
             self._initNewCase(id)
 
-        return self.case_cls(id)
+        case = self.case_cls(id)
+        case.checkValidity()
+        return case
 
     def _updateMasterOnCreate(self, instance_tree, data):
         id = instance_tree.getRootNode().getIdentifier()



More information about the Mpuls-commits mailing list