Fix return values on confirm code
This commit is contained in:
parent
c738113ca4
commit
f0add0e6cf
2 changed files with 7 additions and 5 deletions
|
@ -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):
|
||||
|
|
|
@ -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'])
|
||||
|
|
Reference in a new issue