Skip to content

Commit

Permalink
[FIX] auth_saml: Fix KeyError using auth_oauth module. (OCA#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 and Jairo Llopis committed Mar 19, 2020
1 parent 7ca47b1 commit 782783c
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 782783c

Please sign in to comment.