[Python-checkins] r75990 - tracker/roundup-src/roundup/cgi/actions.py

martin.v.loewis python-checkins at python.org
Sat Oct 31 13:18:41 CET 2009


Author: martin.v.loewis
Date: Sat Oct 31 13:18:40 2009
New Revision: 75990

Log:
reject invalid numbers, so that postgres doesn't have to


Modified:
   tracker/roundup-src/roundup/cgi/actions.py

Modified: tracker/roundup-src/roundup/cgi/actions.py
==============================================================================
--- tracker/roundup-src/roundup/cgi/actions.py	(original)
+++ tracker/roundup-src/roundup/cgi/actions.py	Sat Oct 31 13:18:40 2009
@@ -245,6 +245,11 @@
                         # replace the single value with the split list
                         for v in l:
                             self.form.value.append(cgi.MiniFieldStorage(key, v))
+                elif isinstance(prop, hyperdb.Number):
+                    try:
+                        float(self.form[key].value)
+                    except ValueError:
+                        raise exceptions.FormError, "Invalid number: "+self.form[key].value
 
             self.form.value.append(cgi.MiniFieldStorage('@filter', key))
 


More information about the Python-checkins mailing list