diff options
| author | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
|---|---|---|
| committer | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
| commit | cdff4611b0a588546afb9b706bbd2d0fbda7bf2f (patch) | |
| tree | 0a0a99b33e52547987ab69b2a29f3ec23c188142 /addons/auth_oauth/controllers/main.py | |
| parent | 7202b8f7efbc76e2a40b1a4a8d7a95ed0d2ce573 (diff) | |
| parent | ba97319054728490e4d8a601382dd6fd2ab4f970 (diff) | |
[MERGE] merge with main addons
bzr revid: rpr@tinyerp.com-20121005120503-07e0zo8ucv8k0q3s
Diffstat (limited to 'addons/auth_oauth/controllers/main.py')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 11 |
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 |
