108536490: Fix bug when user does not exist and tries to sign in

This commit is contained in:
Rebecca Law
2015-12-01 10:35:49 +00:00
parent 0a20d0dddf
commit e8d2a81597
2 changed files with 10 additions and 2 deletions

View File

@@ -20,12 +20,12 @@ def process_sign_in():
form = LoginForm()
if form.validate_on_submit():
user = users_dao.get_user_by_email(form.email_address.data)
if user is None:
return jsonify(authorization=False), 401
if user.is_locked():
return jsonify(locked_out=True), 401
if not user.is_active():
return jsonify(active_user=False), 401
if user is None:
return jsonify(authorization=False), 401
if checkpw(form.password.data, user.password):
login_user(user)
else: