[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
This commit is contained in:
Kersten Jeremy 2014-03-21 12:50:18 +01:00
parent 0e4cfe0add
commit 1d4b43eb38
1 changed files with 3 additions and 0 deletions

View File

@ -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: