cubicweb/web/formwidgets.py
changeset 11929 fcbd6b251d81
parent 11875 011730a4af73
parent 11921 a03376213747
child 11930 83a921bae21c
--- a/cubicweb/web/formwidgets.py	Mon Jan 23 15:35:19 2017 +0100
+++ b/cubicweb/web/formwidgets.py	Fri Jan 27 16:26:09 2017 +0100
@@ -790,8 +790,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: