From f0add0e6cfa028f15aab5c95910deee9f3e1fa5f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 17 Jan 2014 17:23:52 -0500 Subject: [PATCH] Fix return values on confirm code --- data/model.py | 2 +- endpoints/web.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/data/model.py b/data/model.py index c01f2dbc0..12658289c 100644 --- a/data/model.py +++ b/data/model.py @@ -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): diff --git a/endpoints/web.py b/endpoints/web.py index 2cb769f09..4d4a7503d 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -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'])