diff options
| author | DJ Patel <mdi@tinyerp.com> | 2014-04-17 12:15:01 +0530 |
|---|---|---|
| committer | DJ Patel <mdi@tinyerp.com> | 2014-04-17 12:15:01 +0530 |
| commit | 483fe85c2b3e659bfdb3d2e483e8bbaab3fcf4e4 (patch) | |
| tree | a7e46439e5cf609578130abe6a6d9c041734841d /addons/auth_oauth/controllers | |
| parent | 7d5b66c526fc2137d1f65cb881ebe2409e2b2234 (diff) | |
| parent | dd47f684f0d0d5f8844d8893d3bbc9eee2a48c46 (diff) | |
[Merge] Merged with main branch.
bzr revid: mdi@tinyerp.com-20140417064501-cf2rp86sukob7v1a
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 |
