diff --git a/tailbone/forms/types.py b/tailbone/forms/types.py index 3e4952e4..ac7f2d43 100644 --- a/tailbone/forms/types.py +++ b/tailbone/forms/types.py @@ -87,7 +87,7 @@ class FalafelDateTime(colander.DateTime): def serialize(self, node, appstruct): if not appstruct: - return colander.null + return {} # cant use isinstance; dt subs date if type(appstruct) is datetime.date: @@ -111,6 +111,9 @@ class FalafelDateTime(colander.DateTime): if not cstruct: return colander.null + if not cstruct['date'] and not cstruct['time']: + return colander.null + try: date = datetime.datetime.strptime(cstruct['date'], '%Y-%m-%d').date() except: