Fix return values on confirm code

This commit is contained in:
Joseph Schorr 2014-01-17 17:23:52 -05:00
parent c738113ca4
commit f0add0e6cf
2 changed files with 7 additions and 5 deletions

View file

@ -367,7 +367,7 @@ def confirm_user_email(code):
code.delete_instance()
return {'user': user, 'new_email': new_email}
return user, new_email
def create_reset_password_email_code(email):

View file

@ -255,15 +255,17 @@ def github_oauth_attach():
@app.route('/confirm', methods=['GET'])
def confirm_email():
code = request.values['code']
user = None
new_email = None
try:
result = model.confirm_user_email(code)
user, new_email = model.confirm_user_email(code)
except model.DataModelException as ex:
return render_page_template('confirmerror.html', error_message=ex.message)
return render_page_template('confirmerror.html', error_message=ex.message)
common_login(result['user'])
common_login(user)
return redirect(url_for('user', tab='email') if result['new_email'] else url_for('index'))
return redirect(url_for('user', tab='email') if new_email else url_for('index'))
@app.route('/recovery', methods=['GET'])