From 603cc7092a2a490c7d9ae521e92e1f15a2cccc68 Mon Sep 17 00:00:00 2001 From: geomapdev Date: Wed, 4 Oct 2017 10:39:42 -0700 Subject: [PATCH] dal.py more code cleanup --- gluon/dal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gluon/dal.py b/gluon/dal.py index e4abd6fa..b0e095c5 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -63,7 +63,7 @@ def _default_validators(db, field): if field.unique: requires._and = validators.IS_NOT_IN_DB(db, field) if not field.notnull: - return validators.IS_EMPTY_OR(requires) + requires = validators.IS_EMPTY_OR(requires) return requires elif db and field_type.startswith('list:reference'): if field_type.find('.') < 0 and field_type[15:] in db.tables: @@ -87,7 +87,7 @@ def _default_validators(db, field): multiple=True) if field.unique: requires._and = validators.IS_NOT_IN_DB(db, field) - if field.notnull: + if not field.notnull: requires = validators.IS_EMPTY_OR(requires) return requires # does not get here for reference and list:reference