From 9f633c46903ca69ca53982a8fed87a68ef348170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lombra=C3=B1a=20Gonz=C3=A1lez?= Date: Tue, 20 Dec 2016 17:18:50 +0100 Subject: [PATCH] Work on redirect. --- pybossa/view/account.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pybossa/view/account.py b/pybossa/view/account.py index f9f7be4c12..839bdec9b8 100644 --- a/pybossa/view/account.py +++ b/pybossa/view/account.py @@ -39,7 +39,7 @@ import pybossa.model as model from flask.ext.babel import gettext from pybossa.core import signer, uploader, sentinel, newsletter -from pybossa.util import Pagination +from pybossa.util import Pagination, handle_content_type from pybossa.util import get_user_signup_method from pybossa.cache import users as cached_users from pybossa.auth import ensure_authorized_to @@ -124,10 +124,12 @@ def signin(): auth['facebook'] = True if ('google' in current_app.blueprints): # pragma: no cover auth['google'] = True - return render_template('account/signin.html', - title="Sign in", - form=form, auth=auth, - next=request.args.get('next')) + response = dict(template='account/signin.html', + title="Sign in", + form=form, + auth=auth, + next=request.args.get('next')) + return handle_content_type(response) else: # User already signed in, so redirect to home page return redirect(url_for("home.home"))