summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers
diff options
context:
space:
mode:
authorRichard Mathot <rim@openerp.com>2014-07-02 13:56:11 +0200
committerRichard Mathot <rim@openerp.com>2014-07-02 13:56:11 +0200
commit376cdf36b43381c06066cb0b6e5d0ef4b0c45c3b (patch)
tree1b0d1ec3dcde6c8c3300d0dec945f69cade6b82b /addons/auth_oauth/controllers
parent581341ce3f91f997a7543fa9385a1764c0c53134 (diff)
[FIX] auth_oauth: prevent crash on login screen
Empty URLs for OAuth providers do not crash anymore the login screen
Diffstat (limited to 'addons/auth_oauth/controllers')
-rw-r--r--addons/auth_oauth/controllers/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 214fdefe1fb..fe3c8bef905 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -48,7 +48,8 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home):
def list_providers(self):
try:
provider_obj = request.registry.get('auth.oauth.provider')
- providers = provider_obj.search_read(request.cr, SUPERUSER_ID, [('enabled', '=', True)])
+ providers = provider_obj.search_read(request.cr, SUPERUSER_ID, [('enabled', '=', True), ('auth_endpoint', '!=', False), ('validation_endpoint', '!=', False)])
+ # TODO in forwardport: remove conditions on 'auth_endpoint' and 'validation_endpoint' when these fields will be 'required' in model
except Exception:
providers = []
for provider in providers: