From 770de41a9ee63c3b3ecea30899b471ef4c1d7b17 Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Mon, 8 Jan 2024 15:13:52 +0100 Subject: [PATCH] FIX auth_saml: password reset when deactivating the config settings --- auth_saml/models/ir_config_parameter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/auth_saml/models/ir_config_parameter.py b/auth_saml/models/ir_config_parameter.py index 9fb503afac..dd8677d0fa 100644 --- a/auth_saml/models/ir_config_parameter.py +++ b/auth_saml/models/ir_config_parameter.py @@ -27,3 +27,13 @@ def write(self, vals): if self.filtered(lambda param: param.key == ALLOW_SAML_UID_AND_PASSWORD): self.env["res.users"].allow_saml_and_password_changed() return result + + def unlink(self): + """Redefined to update users when our parameter is deleted.""" + param_saml = self.filtered( + lambda param: param.key == ALLOW_SAML_UID_AND_PASSWORD + ) + result = super().unlink() + if result and param_saml: + self.env["res.users"].allow_saml_and_password_changed() + return result