[Mpuls-commits] r5226 - wasko/trunk/waskoweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Aug 8 16:05:55 CEST 2011


Author: bh
Date: 2011-08-08 16:05:54 +0200 (Mon, 08 Aug 2011)
New Revision: 5226

Modified:
   wasko/trunk/waskoweb/controllers/caselifetime.py
Log:
When reopenting a case, do not check rules for datum_cm_ende.
datum_cm_ende is only in the HTML form as a hidden field and is used to
make sure the reopening dates are later than the end of CM, but it's not
inserted into the new case created by the reopening and checking rules
for it may trigger the backdating rules.


Modified: wasko/trunk/waskoweb/controllers/caselifetime.py
===================================================================
--- wasko/trunk/waskoweb/controllers/caselifetime.py	2011-08-04 12:24:27 UTC (rev 5225)
+++ wasko/trunk/waskoweb/controllers/caselifetime.py	2011-08-08 14:05:54 UTC (rev 5226)
@@ -603,9 +603,15 @@
             session['lifetimeparams'] = form_result
             session.save()
             try:
-                # Lets try to insert some dates (do not actually insert them)
-                # and check if they match all rules.
-                S(it, form_result, case_id, do_write=False)
+                # Lets try to insert some dates (do not actually insert
+                # them) and check if they match all rules. Omit
+                # datum_cm_ende from the rule check because it's only in
+                # the form to make sure the new dates are later than
+                # datum_cm_ende and trying to set it may trigger the
+                # backdating rules.
+                data_for_rule_check = form_result.copy()
+                del data_for_rule_check["datum_cm_ende"]
+                S(it, data_for_rule_check, case_id, do_write=False)
                 if (form_result.get('cm_wiederauf_genehm_1') == '1'
                     or form_result.get('cm_wiederauf_genehm_2') == '1'):
                     return self.reopen_ok(session['case'].id)



More information about the Mpuls-commits mailing list