cubicweb/web/formwidgets.py
branch3.24
changeset 11921 a03376213747
parent 11767 432f87a63057
child 11929 fcbd6b251d81
--- a/cubicweb/web/formwidgets.py	Fri Jan 20 15:16:18 2017 +0100
+++ b/cubicweb/web/formwidgets.py	Thu Jan 26 16:33:15 2017 +0100
@@ -801,8 +801,12 @@
 
     def process_field_data(self, form, field):
         req = form._cw
-        datestr = req.form.get(field.input_name(form, 'date')).strip() or None
-        timestr = req.form.get(field.input_name(form, 'time')).strip() or None
+        datestr = req.form.get(field.input_name(form, 'date'))
+        if datestr:
+            datestr = datestr.strip() or None
+        timestr = req.form.get(field.input_name(form, 'time'))
+        if timestr:
+            timestr = timestr.strip() or None
         if datestr is None:
             return None
         try: