108536490: Implement locked out function.

User is locked if they fail to login 10 times or more.
This commit is contained in:
Rebecca Law
2015-11-30 16:33:45 +00:00
parent ff9e98907e
commit 3b27db98ff
5 changed files with 65 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ class User(db.Model):
return self.id
def is_locked(self):
if self.failed_login_count <= current_app.config['MAX_FAILED_LOGIN_COUNT']:
if self.failed_login_count < current_app.config['MAX_FAILED_LOGIN_COUNT']:
return False
else:
return True