summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers/main.py
diff options
context:
space:
mode:
authorParamjit Singh Sahota <psa@tinyerp.com>2013-06-20 12:07:04 +0530
committerParamjit Singh Sahota <psa@tinyerp.com>2013-06-20 12:07:04 +0530
commitd6b1e6d33c0ed35104f11cd7ebd82ed1d55cfea1 (patch)
tree34a5d70a583966a20a28a09824ad8785edb7de8d /addons/auth_oauth/controllers/main.py
parente6c711af32f2a75ad65aef5cdc8c9bd2cff9f4f5 (diff)
parent9ebfb79b6b4bd8cd2367c4467a935752e4f92e02 (diff)
[MERGE] Merged lp:openobject-addons.
bzr revid: psa@tinyerp.com-20130620063704-seb26bkaep3fmnic
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 = {