[ADD] web: add a route '/web/dbredirect' to ensure the connection to the right databa...
authorJeremy Kersten <jke@odoo.com>
Fri, 24 Oct 2014 15:01:49 +0000 (17:01 +0200)
committerJeremy Kersten <jke@odoo.com>
Fri, 24 Oct 2014 15:19:55 +0000 (17:19 +0200)
addons/web/controllers/main.py

index c057f7c..2e44fff 100644 (file)
@@ -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()