[Mpuls-commits] r3790 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Sep 27 16:46:38 CEST 2010


Author: bh
Date: 2010-09-27 16:46:37 +0200 (Mon, 27 Sep 2010)
New Revision: 3790

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py (FormularpageController.save)
(FormularpageController._check_case_validity): Move the validity
checking code from the save method into the new method
_check_case_validity.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-09-27 13:56:22 UTC (rev 3789)
+++ base/trunk/ChangeLog	2010-09-27 14:46:37 UTC (rev 3790)
@@ -1,6 +1,13 @@
 2010-09-27  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/controllers/formularpage.py (FormularpageController.save)
+	(FormularpageController._check_case_validity): Move the validity
+	checking code from the save method into the new method
+	_check_case_validity.
+
+2010-09-27  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/controllers/formularpage.py (FormularpageController.save)
 	(FormularpageController._handle_automatic_phase_change): Move the
 	automatic phase change code from the save method to the new method
 	_handle_automatic_phase_change.

Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2010-09-27 13:56:22 UTC (rev 3789)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2010-09-27 14:46:37 UTC (rev 3790)
@@ -209,9 +209,7 @@
                 page_id = session['navigation.tree'].getTreeItem(page_id).nextKey().key
 
             # Check consistence of case and retag
-            if g.mpuls_config.is_enabled ('case-module', 'checktags'):
-                case = self._loadCase(session['case'].id)
-                case.checkValidity()
+            self._check_case_validity(session['case'].id)
 
         except SetDataException, err:
             # Do nothing than setting the status message. In the future the
@@ -228,6 +226,14 @@
 
         return self.select(page_id)
 
+    def _check_case_validity(self, case_id):
+        """Check validity of the case given by case_id.
+        If the checktags case-module is not enabled, this method does nothing.
+        """
+        if g.mpuls_config.is_enabled ('case-module', 'checktags'):
+            case = self._loadCase(case_id)
+            case.checkValidity()
+
     def _handle_automatic_phase_change(self, page_id):
         """Change Phase automatically depending on the state of the case"""
         changemode = g.mpuls_config.get('phases', 'changemode')



More information about the Mpuls-commits mailing list