From 6e48c892ddc815d857800659c19d9c89fafcfff1 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 24 Oct 2014 17:01:49 +0200 Subject: [PATCH] [ADD] web: add a route '/web/dbredirect' to ensure the connection to the right database via the get param db. --- addons/web/controllers/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index c057f7c3fb3..2e44fffd312 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -467,7 +467,6 @@ class Home(http.Controller): @http.route('/web', type='http', auth="none") def web_client(self, s_action=None, **kw): ensure_db() - if request.session.uid: if kw.get('redirect'): return werkzeug.utils.redirect(kw.get('redirect'), 303) @@ -479,6 +478,11 @@ class Home(http.Controller): else: return login_redirect() + @http.route('/web/dbredirect', type='http', auth="none") + def web_db_redirect(self, redirect='/', **kw): + ensure_db() + return werkzeug.utils.redirect(redirect, 303) + @http.route('/web/login', type='http', auth="none") def web_login(self, redirect=None, **kw): ensure_db()