From 1d4b43eb38cd1e3064d1fdd4b777c819f4c04865 Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Fri, 21 Mar 2014 12:50:18 +0100 Subject: [PATCH] [FIX] Redirect user from /web if a get redirect is found. If you redirect an user not logged, into /web?redirect=xxx, he was correctly redirect to /web/login?redirect=/web?redirect=xxx. But when user come back on /web?redirect=xxx, he was not redirected to xxx. The question should be to have only one behavior when we redirect people, as well /web?redirect as well /web/login?redirect. But because we use both in actual code, we need to accept both for retro-compatibility. bzr revid: jke@openerp.com-20140321115018-x4e3l3d1v0tp0dyo --- addons/web/controllers/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index c30cd052bd6..b771f1f378e 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -654,6 +654,9 @@ class Home(http.Controller): ensure_db() if request.session.uid: + if kw.get('redirect'): + return werkzeug.utils.redirect(kw.get('redirect'), 303) + html = render_bootstrap_template(request.session.db, "web.webclient_bootstrap") return request.make_response(html, {'Cache-Control': 'no-cache', 'Content-Type': 'text/html; charset=utf-8'}) else: