[IMP] auth_oauth: allow to redirect to a given action

bzr revid: chs@openerp.com-20121205161022-bsf2el39azao9iqk
This commit is contained in:
Christophe Simonis 2012-12-05 17:10:22 +01:00
parent d65709f68b
commit 19b878ca55
1 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,9 @@ class OAuthController(oeweb.Controller):
u = registry.get('res.users')
credentials = u.auth_oauth(cr, SUPERUSER_ID, provider, kw, context=context)
cr.commit()
return login_and_redirect(req, *credentials)
action = state.get('a', None)
url = '/#action=' + action if action else '/'
return login_and_redirect(req, *credentials, redirect_url=url)
except AttributeError:
# auth_signup is not installed
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,))