109898688: All codes are valid until one code is used, then they are all marked used.

Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active.
There is still a problem with the validate_sms_code and validate_email_code method.
This commit is contained in:
Rebecca Law
2015-12-16 12:20:25 +00:00
parent bd8bb3c926
commit 64812c1614
18 changed files with 259 additions and 203 deletions

View File

@@ -19,7 +19,6 @@ def check_and_resend_email_code():
if form.validate_on_submit():
user = users_dao.get_user_by_id(session['user_id'])
users_dao.update_email_address(id=user.id, email_address=form.email_address.data)
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='email')
send_email_code(user_id=user.id, email=user.email_address)
return redirect('/verify')
return jsonify(form.errors), 400
@@ -37,7 +36,6 @@ def check_and_resend_text_code():
if form.validate_on_submit():
user = users_dao.get_user_by_id(session['user_id'])
users_dao.update_mobile_number(id=user.id, mobile_number=form.mobile_number.data)
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='sms')
send_sms_code(user_id=user.id, mobile_number=user.mobile_number)
return redirect('/verify')
return jsonify(form.errors), 400