Tweak variable name.
This commit is contained in:
parent
b7aa4b36d0
commit
7d42950527
|
@ -169,10 +169,10 @@ class UserCrud(CrudView):
|
||||||
])
|
])
|
||||||
|
|
||||||
if self.creating:
|
if self.creating:
|
||||||
def valid_username(value, field):
|
def unique_username(value, field):
|
||||||
if Session.query(User).filter_by(username=value).count():
|
if Session.query(User).filter_by(username=value).count():
|
||||||
raise ValidationError("Username must be unique.")
|
raise ValidationError("Username must be unique.")
|
||||||
fs.username.set(validate=valid_username)
|
fs.username.set(validate=unique_username)
|
||||||
|
|
||||||
if self.readonly:
|
if self.readonly:
|
||||||
del fs.password
|
del fs.password
|
||||||
|
|
Loading…
Reference in a new issue