From 565c92dd71d0c1902289e9f60fd843f53148553f Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 17 May 2019 11:01:15 +0200 Subject: [PATCH] views: do not set password on unlink for LDAP users (#24170) --- src/authentic2_auth_fc/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authentic2_auth_fc/views.py b/src/authentic2_auth_fc/views.py index d446574..f6b0b15 100644 --- a/src/authentic2_auth_fc/views.py +++ b/src/authentic2_auth_fc/views.py @@ -527,7 +527,7 @@ class UnlinkView(LoggerMixin, FormView): def must_set_password(self): for event in self.request.session.get(constants.AUTHENTICATION_EVENTS_SESSION_KEY, []): if event['how'].startswith('password'): - return False + return self.request.user.can_change_password() return True def dispatch(self, request, *args, **kwargs): -- 2.20.1