From fae29bf0e199d54c9aa7e9022c0e9d663ea0e432 Mon Sep 17 00:00:00 2001 From: Luca de Alfaro Date: Sat, 7 Sep 2013 16:57:17 -0700 Subject: [PATCH] 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. --- gluon/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/validators.py b/gluon/validators.py index 7b4294f1..5622249f 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -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