Tweak variable name.

This commit is contained in:
Lance Edgar 2015-01-15 01:49:17 -06:00
parent b7aa4b36d0
commit 7d42950527

View file

@ -169,10 +169,10 @@ class UserCrud(CrudView):
])
if self.creating:
def valid_username(value, field):
def unique_username(value, field):
if Session.query(User).filter_by(username=value).count():
raise ValidationError("Username must be unique.")
fs.username.set(validate=valid_username)
fs.username.set(validate=unique_username)
if self.readonly:
del fs.password