aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/forms.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-13 21:20:20 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-13 21:20:20 +0200
commitca396255e9c8b59a122511436e87f15cae04a9f8 (patch)
treeeecfb87e97f28e7b6507fb23e981bdf33af1f209 /pyaggr3g470r/forms.py
parentsync (diff)
downloadnewspipe-ca396255e9c8b59a122511436e87f15cae04a9f8.tar.gz
newspipe-ca396255e9c8b59a122511436e87f15cae04a9f8.tar.bz2
newspipe-ca396255e9c8b59a122511436e87f15cae04a9f8.zip
Check if the account has been confirmed.
Diffstat (limited to 'pyaggr3g470r/forms.py')
-rw-r--r--pyaggr3g470r/forms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py
index fe2dd0d8..d241b90a 100644
--- a/pyaggr3g470r/forms.py
+++ b/pyaggr3g470r/forms.py
@@ -69,8 +69,11 @@ class SigninForm(Form):
return False
user = User.query.filter(User.email == self.email.data).first()
- if user and user.check_password(self.password.data):
+ if user and user.check_password(self.password.data) and user.activation_key == "":
return True
+ elif user.activation_key != "":
+ flash(lazy_gettext('Account not confirmed'), 'danger')
+ return False
else:
flash(lazy_gettext('Invalid email or password'), 'danger')
#self.email.errors.append("Invalid email or password")
bgstack15