Update validators.py

Updated the IS_DATETIME validator; otherwise it would fail when creating a new record with SQLFORM, for dates that have an empty default.
This commit is contained in:
Luca de Alfaro
2013-09-07 16:57:17 -07:00
parent b0f6f29de5
commit fae29bf0e1
+1 -1
View File
@@ -2341,7 +2341,7 @@ class IS_DATETIME(Validator):
return (ovalue, translate(self.error_message) % self.extremes)
def formatter(self, value):
if value is None:
if value is None or value == '':
return None
format = self.format
year = value.year