summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/auth_oauth/controllers/main.py')
-rw-r--r--addons/auth_oauth/controllers/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 3f7ef2f3f0c..62eb2e812cc 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -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 = {