[ADD] web: add a route '/web/dbredirect' to ensure the connection to the right database via the get param db.

This commit is contained in:
Jeremy Kersten 2014-10-24 17:01:49 +02:00
parent 440fb712cb
commit 6e48c892dd
1 changed files with 5 additions and 1 deletions

View 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()