Fix IS_NOT_IN_DB to work with custom primarykey

Validator currently selects custom id properly, but then explicitly checks .id
This commit is contained in:
Tim Nyborg
2015-12-03 15:02:21 +00:00
parent db37cf6a58
commit b942fc8f7a

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)