diff options
| author | Christophe Simonis <chs@openerp.com> | 2014-04-10 13:04:24 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2014-04-10 13:04:24 +0200 |
| commit | 3a7e003656910d6a8a552684029a47816a137fb5 (patch) | |
| tree | 707815e1d9698d15f84ef649e50b918d9530265f /addons/auth_oauth/controllers | |
| parent | e521085fff15e06fea09353c0a531b93874a25e0 (diff) | |
| parent | bd7804272b5b161b1e523570b750df619795766c (diff) | |
[MERGE] forward port of branch saas-3 up to revid 9394 chs@openerp.com-20140410103638-x7vajn70ewsfp0ck
bzr revid: chs@openerp.com-20140410110424-enhdg6pufhii56ni
Diffstat (limited to 'addons/auth_oauth/controllers')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index b4ce20d49e3..4fca426ffc0 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -2,6 +2,7 @@ import functools import logging import simplejson +import urlparse import werkzeug.utils from werkzeug.exceptions import BadRequest @@ -68,7 +69,8 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): def get_state(self, provider): state = dict( d=request.session.db, - p=provider['id'] + p=provider['id'], + r=request.httprequest.full_path ) token = request.params.get('token') if token: @@ -137,8 +139,12 @@ class OAuthController(http.Controller): cr.commit() action = state.get('a') menu = state.get('m') + redirect = state.get('r') url = '/web' - if action: + if redirect and not redirect.startswith('/auth_oauth/signin') and \ + (not redirect.startswith('/web/login') or 'redirect' in urlparse.urlsplit(redirect).query): + url = redirect + elif action: url = '/web#action=%s' % action elif menu: url = '/web#menu_id=%s' % menu |
