Skip to content

Commit

Permalink
[FIX] auth_saml: Fix KeyError using auth_oauth module. (#149)
Browse files Browse the repository at this point in the history
The following line of code for 11.0:
 - https://github.com/odoo/odoo/blob/52d6f0e3ee90874fc93fec9cdff74ec71d3b991f/addons/auth_oauth/controllers/main.py#L69

is assigning the key "auth_link" for "list_providers" method.

The following template is expecting this key:
 - https://github.com/odoo/odoo/blob/52d6f0e3ee90874fc93fec9cdff74ec71d3b991f/addons/auth_oauth/views/auth_oauth_templates.xml#L5

So, it raise a KeyError compiling "template_auth_oauth_providers_N"

This change is fixing adding that expected key in order to avoid this KeyError
  • Loading branch information
moylop260 authored Nov 29, 2019
1 parent b9c0f83 commit 96b3dfb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth_saml/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def list_providers(self):
except Exception as e:
_logger.exception("SAML2: %s" % str(e))
providers = []

for provider in providers:
# Compatibility with auth_oauth/controllers/main.py in order to
# avoid KeyError rendering template_auth_oauth_providers
provider['auth_link'] = ""
return providers

@http.route()
Expand Down

0 comments on commit 96b3dfb

Please sign in to comment.