[Mpuls-commits] r3793 - in wasko/trunk: . waskoweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Sep 27 18:23:47 CEST 2010


Author: bh
Date: 2010-09-27 18:23:47 +0200 (Mon, 27 Sep 2010)
New Revision: 3793

Modified:
   wasko/trunk/ChangeLog
   wasko/trunk/waskoweb/controllers/formularpage.py
Log:
* waskoweb/controllers/formularpage.py (FormularpageController.save)
(FormularpageController._create_appointments_for_too_long_cm):
Move the appointment generation from the save method to the new
method _create_appointments_for_too_long_cm


Modified: wasko/trunk/ChangeLog
===================================================================
--- wasko/trunk/ChangeLog	2010-09-27 15:06:56 UTC (rev 3792)
+++ wasko/trunk/ChangeLog	2010-09-27 16:23:47 UTC (rev 3793)
@@ -1,6 +1,13 @@
 2010-09-27  Bernhard Herzog  <bh at intevation.de>
 
 	* waskoweb/controllers/formularpage.py (FormularpageController.save)
+	(FormularpageController._create_appointments_for_too_long_cm):
+	Move the appointment generation from the save method to the new
+	method _create_appointments_for_too_long_cm
+
+2010-09-27  Bernhard Herzog  <bh at intevation.de>
+
+	* waskoweb/controllers/formularpage.py (FormularpageController.save)
 	(FormularpageController._handle_evaluation_number): Move the
 	evaluation number handling code from the save method into the new
 	method _handle_evaluation_number.

Modified: wasko/trunk/waskoweb/controllers/formularpage.py
===================================================================
--- wasko/trunk/waskoweb/controllers/formularpage.py	2010-09-27 15:06:56 UTC (rev 3792)
+++ wasko/trunk/waskoweb/controllers/formularpage.py	2010-09-27 16:23:47 UTC (rev 3793)
@@ -104,15 +104,18 @@
             #error_status(_('Error while saving data'))
             session['uncommited_fields'] = instance_tree.commit()
             session.save()
-        
-        
-        
+
+        self._create_appointments_for_too_long_cm(case_id, form_result)
+
+        phase_changed = self._handle_automatic_phase_change(page_id)
+        if phase_changed:
+            return phase_changed
+
+        return self.select(page_id)
+
+    def _create_appointments_for_too_long_cm(self, case_id, form_result):
+        """Create appointments for cases that have been in CM for too long.
         """
-        Calculate the total length of the CM, including extensions and create
-        a new appointment if the length is longer than a certain limit
-        
-        NOTE: this solution is not yet optimal
-        """
         if (u'datum_cm_start:%s' % case_id in form_result or
                 u'datum_cm_ende:%s' % case_id in form_result or
                 u'cm_datum_verlaengerung_1:%s' % case_id in form_result or 
@@ -194,14 +197,7 @@
             
                 appointment.setData(appointment_data)
                 appointment.store()
-        
-        
-        phase_changed = self._handle_automatic_phase_change(page_id)
-        if phase_changed:
-            return phase_changed
 
-        return self.select(page_id)
-
     def _handle_evaluation_number(self, case_id, form_result):
         """Set or Reset the evaluation number if the form_result is for page 2
         """



More information about the Mpuls-commits mailing list