From bdbc053285b67fd3ee02f2ea862b30ca495f33e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Thu, 14 Apr 2016 03:57:20 +0100 Subject: [PATCH] fixes #1274 --- gluon/dal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/dal.py b/gluon/dal.py index 1c2a76fe..baeb624f 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -79,7 +79,7 @@ def _default_validators(db, field): if (field.notnull or field.unique) and not field_type in excluded_fields: requires.insert(0,validators.IS_NOT_EMPTY()) elif not field.notnull and not field.unique and requires: - requires[0] = validators.IS_EMPTY_OR(requires[0]) + requires[0] = validators.IS_EMPTY_OR(requires[0], null='' if field in ('string', 'text', 'password') else None) return requires from gluon.serializers import custom_json, xml