From 1847311f026ec3898af1882ac0548da70c9da781 Mon Sep 17 00:00:00 2001 From: Ricky Zhou Date: Wed, 19 Dec 2007 14:06:00 -0700 Subject: [PATCH] Add toshio's fix for the incorrect http redirects. --- fas/dev.cfg | 2 +- fas/fas/controllers.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fas/dev.cfg b/fas/dev.cfg index a679173..3f500b7 100644 --- a/fas/dev.cfg +++ b/fas/dev.cfg @@ -54,7 +54,7 @@ tg.strict_parameters = True server.webpath='/fas' base_url_filter.on=True -base_url = "https://publictest1.fedoraproject.org" +base_url_filter.base_url = "https://publictest1.fedoraproject.org/fas" # Make the session cookie only return to the host over an SSL link # Disabled for testing. diff --git a/fas/fas/controllers.py b/fas/fas/controllers.py index 4dab435..3b6a1d1 100644 --- a/fas/fas/controllers.py +++ b/fas/fas/controllers.py @@ -60,6 +60,8 @@ class Root(controllers.RootController): and identity.was_login_attempted() \ and not identity.get_identity_errors(): turbogears.flash(_('Welcome, %s') % Person.byUserName(turbogears.identity.current.user_name).givenName) + if not forward_url: + forward_url = config.get('base_url_filter.base_url') + '/' raise redirect(forward_url) forward_url=None @@ -84,4 +86,4 @@ class Root(controllers.RootController): def logout(self): identity.current.logout() turbogears.flash(_('You have successfully logged out.')) - raise redirect("/") + raise redirect(request.headers.get("Referer", "/"))