Skip to content

Commit 782783c

Browse files
moylop260Jairo Llopis
authored andcommitted
[FIX] auth_saml: Fix KeyError using auth_oauth module. (OCA#149)
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
1 parent 7ca47b1 commit 782783c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

auth_saml/controllers/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def list_providers(self):
5757
except Exception as e:
5858
_logger.exception("SAML2: %s" % str(e))
5959
providers = []
60-
60+
for provider in providers:
61+
# Compatibility with auth_oauth/controllers/main.py in order to
62+
# avoid KeyError rendering template_auth_oauth_providers
63+
provider['auth_link'] = ""
6164
return providers
6265

6366
@http.route()

0 commit comments

Comments
 (0)