From 840818605c1258aabf6714a835af27bf834dd744 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 19 Jun 2014 10:26:28 +0200 Subject: Check if the account of the user is activated when accessing via the Web service. --- pyaggr3g470r/rest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyaggr3g470r/rest.py') diff --git a/pyaggr3g470r/rest.py b/pyaggr3g470r/rest.py index 6efa9881..1c597bdd 100644 --- a/pyaggr3g470r/rest.py +++ b/pyaggr3g470r/rest.py @@ -51,7 +51,7 @@ def authenticate(func): try: email = auth.username user = User.query.filter(User.email == email).first() - if user and user.check_password(auth.password): + if user and user.check_password(auth.password) and user.activation_key == "": g.user = user return func(*args, **kwargs) except AttributeError: @@ -122,4 +122,4 @@ class ArticleAPI(Resource): """ pass -api.add_resource(ArticleAPI, '/articles.json/', endpoint = 'articles.json') \ No newline at end of file +api.add_resource(ArticleAPI, '/articles.json/', endpoint = 'articles.json') -- cgit