Merge pull request #1116 from timnyborg/patch-7

Fix IS_NOT_IN_DB to work with custom primarykey
This commit is contained in:
mdipierro
2015-12-04 10:42:25 -06:00
+1 -1
View File
@@ -694,7 +694,7 @@ class IS_NOT_IN_DB(Validator):
return (value, translate(self.error_message))
else:
row = subset.select(table._id, field, limitby=(0, 1), orderby_on_limitby=False).first()
if row and str(row.id) != str(id):
if row and str(row[table._id]) != str(id):
return (value, translate(self.error_message))
return (value, None)