From ca25e62e3591fd52d381ca3cf3d7dbc327867fb8 Mon Sep 17 00:00:00 2001 From: shagi Date: Thu, 16 Jun 2022 17:33:02 +0200 Subject: [PATCH] Fix password change views --- gas/gas/core/views.py | 1 + gas/gas/users/views.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/gas/gas/core/views.py b/gas/gas/core/views.py index 3700eeb..4adcfbe 100644 --- a/gas/gas/core/views.py +++ b/gas/gas/core/views.py @@ -34,6 +34,7 @@ class GASLoginView(LoginView): class GASPasswordChangeView(GASMixin, PasswordChangeView): template_name = 'gas/base_form.html' success_url = reverse_lazy('gas:index') + continue_url = reverse_lazy('gas:change_password') title = _('Change your password') success_message = _('Password changed.') diff --git a/gas/gas/users/views.py b/gas/gas/users/views.py index ffda20e..5c0a126 100644 --- a/gas/gas/users/views.py +++ b/gas/gas/users/views.py @@ -75,6 +75,9 @@ class ChangePasswordUser(BaseMixin, gviews.GASMixin, FormView): def get_title(self): return _('Change {username} user password').format(username=self.user.username) + def get_continue_url(self): + return reverse('gas:user_change_password', args=(self.kwargs['pk'],)) + def get_form_kwargs(self): kwargs = super().get_form_kwargs() kwargs['user'] = self.user