[Mpuls-commits] r680 - in wasko/branches/1.0: . waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 11 10:11:27 CET 2009


Author: torsten
Date: 2009-11-11 10:11:21 +0100 (Wed, 11 Nov 2009)
New Revision: 680

Modified:
   wasko/branches/1.0/ChangeLog.txt
   wasko/branches/1.0/waskaweb/controllers/caselifetime.py
Log:
Partial fix for issue554


Modified: wasko/branches/1.0/ChangeLog.txt
===================================================================
--- wasko/branches/1.0/ChangeLog.txt	2009-11-11 07:58:26 UTC (rev 679)
+++ wasko/branches/1.0/ChangeLog.txt	2009-11-11 09:11:21 UTC (rev 680)
@@ -9,7 +9,11 @@
 	* waskaweb/controllers/case.py: Inproved confirmation dialog for
 	deleting cases.
 
+	Issue554
 
+	* waskaweb/controllers/caselifetime.py: Added check on None-Values.
+
+
 2009-11-04 	Torsten Irlaender	<torsten.irlaender at intevation.de> 
 
 	Issue567

Modified: wasko/branches/1.0/waskaweb/controllers/caselifetime.py
===================================================================
--- wasko/branches/1.0/waskaweb/controllers/caselifetime.py	2009-11-11 07:58:26 UTC (rev 679)
+++ wasko/branches/1.0/waskaweb/controllers/caselifetime.py	2009-11-11 09:11:21 UTC (rev 680)
@@ -235,17 +235,27 @@
         try:
             if c.num_wiederaufnahme >= 1:
                 last_date = c.casedata.getData('cm_wiederauf_datum_bis_1')
-                c.form_result['cm_wiederauf_datum_bis_2'] = dd_mm_YYYY(last_date+timedelta(days=31*3))
+                if last_date:
+                    c.form_result['cm_wiederauf_datum_bis_2'] = dd_mm_YYYY(last_date+timedelta(days=31*3))
+                else:
+                    c.form_result['cm_wiederauf_datum_bis_2'] = ''
             if c.num_verlaengerung < 1:
                 begin_cm = c.casedata.getData('datum_cm_start')
-                c.form_result['cm_datum_verlaengerung_1'] = dd_mm_YYYY(begin_cm+timedelta(days=458))
+                if begin_cm:
+                    c.form_result['cm_datum_verlaengerung_1'] = dd_mm_YYYY(begin_cm+timedelta(days=458))
+                else:
+                    c.form_result['cm_datum_verlaengerung_1'] = ''
+
             if c.num_verlaengerung  == 1:
                 ende_verl1 = c.casedata.getData('cm_datum_verlaengerung_1')
-                c.form_result['cm_datum_verlaengerung_2'] = dd_mm_YYYY(ende_verl1+timedelta(days=31*3))
+                if ende_verl1:
+                    c.form_result['cm_datum_verlaengerung_2'] = dd_mm_YYYY(ende_verl1+timedelta(days=31*3))
+                else:
+                    c.form_result['cm_datum_verlaengerung_2'] = ''
 
         except Exception, err:
             traceback.print_exc(file=sys.stderr) 
-            c.form_result['cm_wiederauf_datum_bis_1'] = ''
+            c.form_result['cm_wiederauf_datum_bis_2'] = ''
             c.form_result['cm_datum_verlaengerung_1'] = ''
             c.form_result['cm_datum_verlaengerung_2'] = ''
         return render('/caselifetime/overview.mako')



More information about the Mpuls-commits mailing list