diff options
| author | Richard Mathot <rim@openerp.com> | 2014-07-02 13:56:11 +0200 |
|---|---|---|
| committer | Richard Mathot <rim@openerp.com> | 2014-07-02 13:56:11 +0200 |
| commit | 376cdf36b43381c06066cb0b6e5d0ef4b0c45c3b (patch) | |
| tree | 1b0d1ec3dcde6c8c3300d0dec945f69cade6b82b /addons/auth_oauth/controllers/main.py | |
| parent | 581341ce3f91f997a7543fa9385a1764c0c53134 (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/main.py')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 3 |
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: |
