diff --git a/ereuse_devicehub/resources/user/views.py b/ereuse_devicehub/resources/user/views.py index 7053eea7..8eadc863 100644 --- a/ereuse_devicehub/resources/user/views.py +++ b/ereuse_devicehub/resources/user/views.py @@ -18,7 +18,7 @@ def login(): user_s = g.resource_def.SCHEMA(only=('email', 'password')) # type: UserS # noinspection PyArgumentList u = request.get_json(schema=user_s) - user = User.query.filter_by(email=u['email']).one_or_none() + user = User.query.filter_by(email=u['email'], active=True, phantom=False).one_or_none() if user and user.password == u['password']: schema_with_token = g.resource_def.SCHEMA(exclude=set()) return schema_with_token.jsonify(user)