aboutsummaryrefslogtreecommitdiff
path: root/src/web/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/forms.py')
-rw-r--r--src/web/forms.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/web/forms.py b/src/web/forms.py
index 172f31a8..b17d2f7a 100644
--- a/src/web/forms.py
+++ b/src/web/forms.py
@@ -99,10 +99,9 @@ class SigninForm(RedirectForm):
return False
user = User.query.filter(User.email == self.email.data).first()
- if user and user.check_password(self.password.data) \
- and user.activation_key == "":
+ if user and user.check_password(self.password.data) and user.enabled:
return True
- elif user and user.activation_key != "":
+ elif user and not user.enabled:
flash(lazy_gettext('Account not confirmed'), 'danger')
return False
else:
@@ -207,9 +206,9 @@ class RecoverPasswordForm(Form):
return False
user = User.query.filter(User.email == self.email.data).first()
- if user and user.activation_key == "":
+ if user and user.enabled:
return True
- elif user and user.activation_key != "":
+ elif user and not user.enabled:
flash(lazy_gettext('Account not confirmed.'), 'danger')
return False
else:
bgstack15