summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-10-02 10:43:43 +0200
committerFabien Meghazi <fme@openerp.com>2012-10-02 10:43:43 +0200
commitf285c0e481d12edfc2aa9aa1fd3baeb334bc39c6 (patch)
treee28fb555997cdd446f50f42feaf63b1c00b3c695 /addons/auth_oauth/controllers
parenta5fac44994a5d2c0e20cdde0bf72ef152d2342dd (diff)
parent01611481a5aa8fc4723015b4481c9486fa48ef0e (diff)
[IMP] Improved auth_oauth and added OpeneERP Accounts provider demo data
bzr revid: fme@openerp.com-20121002084343-3v1a0vn1pck01tx7
Diffstat (limited to 'addons/auth_oauth/controllers')
-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