[FIX]auth_oauth: controller signin fallback to ?db=dbname if xml_id missing (thus, include case where auth_oauth is not installed)

bzr revid: dle@openerp.com-20130607144849-k1u7ac49q8duqulo
This commit is contained in:
dle@openerp.com 2013-06-07 16:48:49 +02:00
parent 27db64f7a0
commit 1204425a83
1 changed files with 4 additions and 1 deletions

View File

@ -102,7 +102,10 @@ class OAuthController(oeweb.Controller):
registry = RegistryManager.get(dbname)
with registry.cursor() as cr:
IMD = registry['ir.model.data']
model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
try:
model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
except ValueError:
return set_cookie_and_redirect(req, '/?db=%s' % dbname)
assert model == 'auth.oauth.provider'
state = {