From 1c5058c931a6ef55f013ec0c0ca2578ddf75f4a4 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Wed, 2 Jul 2014 14:07:52 +0200 Subject: [PATCH] [FIX] auth_oauth: hide invalid providers from login screen --- addons/auth_oauth/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index 62eb2e812cc..8fb7ce92607 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -46,7 +46,7 @@ class OAuthController(oeweb.Controller): 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)])) + l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True), ('auth_endpoint', '!=', False), ('validation_endpoint', '!=', False)])) except Exception: l = [] return l