aboutsummaryrefslogtreecommitdiff
path: root/src/web/forms.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-18 08:59:13 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-18 08:59:13 +0100
commit2e5a241777ef0bb0d76420d39bf3be41e16e042a (patch)
tree3223b8fba4fa244fa97b0df0b8bf8c5b91aeffec /src/web/forms.py
parentCheck if the id of the category is '0'. (diff)
downloadnewspipe-2e5a241777ef0bb0d76420d39bf3be41e16e042a.tar.gz
newspipe-2e5a241777ef0bb0d76420d39bf3be41e16e042a.tar.bz2
newspipe-2e5a241777ef0bb0d76420d39bf3be41e16e042a.zip
New management of the token for the account confirmation.
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