[Mpuls-commits] r210 - in waska/trunk: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 23 18:05:34 CEST 2008


Author: teichmann
Date: 2008-10-23 18:05:33 +0200 (Thu, 23 Oct 2008)
New Revision: 210

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/lib/helpers.py
Log:
Another fix for issue518 (catch ValueError)



Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-10-23 13:56:34 UTC (rev 209)
+++ waska/trunk/ChangeLog.txt	2008-10-23 16:05:33 UTC (rev 210)
@@ -1,3 +1,9 @@
+2008-10-23	Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Another fix for issue518
+
+	* waskaweb/lib/helpers.py: Catch ValueError when a bad date (22.22.2008) is given.
+
 2008-10-23	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Fixed issue591

Modified: waska/trunk/waskaweb/lib/helpers.py
===================================================================
--- waska/trunk/waskaweb/lib/helpers.py	2008-10-23 13:56:34 UTC (rev 209)
+++ waska/trunk/waskaweb/lib/helpers.py	2008-10-23 16:05:33 UTC (rev 210)
@@ -152,7 +152,10 @@
 def checkDate(value):
     m = VALID_DATE.match(value)
     if not m: return None
-    return datetime.datetime(int(m.group(3)), int(m.group(2)), int(m.group(1)))
+    try:
+        return datetime.datetime(int(m.group(3)), int(m.group(2)), int(m.group(1)))
+    except ValueError:
+        return None
 
 def checkTime(value):
     m = VALID_TIME.match(value)



More information about the Mpuls-commits mailing list