|
|
|
@ -19,14 +19,14 @@ class LoginForm(Form): |
|
|
|
|
|
|
|
|
|
self.user = User.query.filter_by(username=self.username.data).first() |
|
|
|
|
if not self.user: |
|
|
|
|
self.username.errors.append("Unknown username") |
|
|
|
|
self.username.errors.append('Unknown username') |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
if not self.user.check_password(self.password.data): |
|
|
|
|
self.password.errors.append("Invalid password") |
|
|
|
|
self.password.errors.append('Invalid password') |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
if not self.user.active: |
|
|
|
|
self.username.errors.append("User not activated") |
|
|
|
|
self.username.errors.append('User not activated') |
|
|
|
|
return False |
|
|
|
|
return True |
|
|
|
|