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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 5d939f19db1..ae01df5f6f7 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -16,10 +16,13 @@ class OAuthController(openerpweb.Controller):
@openerpweb.jsonrequest
def list_providers(self, req, dbname):
- registry = openerp.modules.registry.RegistryManager.get(dbname)
- with registry.cursor() as cr:
- providers = registry.get('auth.oauth.provider')
- l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled','=',True)]))
+ try:
+ registry = openerp.modules.registry.RegistryManager.get(dbname)
+ with registry.cursor() as cr:
+ providers = registry.get('auth.oauth.provider')
+ l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled','=',True)]))
+ except Exception:
+ l = []
return l
@openerpweb.httprequest