Update dal.py

updated to handle references without format
This commit is contained in:
geomapdev authored and GitHub committed 2017-05-01 08:39:31 -07:00
1 parent ad43249f61
commit 69e6e79e23
1 file changed
+3 -1
+3 -1
View File
@@ -51,9 +51,11 @@ def _default_validators(db, field):
if hasattr(referenced, '_format') and referenced._format:
requires = validators.IS_IN_DB(db, referenced._id,
referenced._format)
else:
requires = validators.IS_IN_DB(db, referenced._id)
if field.unique:
requires._and = validators.IS_NOT_IN_DB(db, field)
if field.tablename == field_type[10:]:
if not field.notnull:
return validators.IS_EMPTY_OR(requires)
return requires
elif db and field_type.startswith('list:reference') and \