Skip to content

Commit

Permalink
FIX auth_saml: password reset when deactivating the config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
leemannd committed Jan 8, 2024
1 parent 19c2da4 commit 770de41
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions auth_saml/models/ir_config_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 770de41

Please sign in to comment.