Add check to force users to change password (#2284)

This commit is contained in:
ser8phin
2021-11-11 11:10:33 +01:00
committed by GitHub
parent 245ad644ff
commit 169a6c51b4
11 changed files with 137 additions and 10 deletions

View File

@@ -226,6 +226,7 @@ class UserSettings(UpdateView):
msgs = []
if 'new_pw' in form.changed_data:
self.request.user.needs_password_change = False
msgs.append(_('Your password has been changed.'))
if 'email' in form.changed_data:
@@ -243,6 +244,8 @@ class UserSettings(UpdateView):
return sup
def get_success_url(self):
if "next" in self.request.GET and url_has_allowed_host_and_scheme(self.request.GET.get("next"), allowed_hosts=None):
return self.request.GET.get("next")
return reverse('control:user.settings')