Fix password change views

This commit is contained in:
Ales (Shagi) Zabala Alava 2022-06-16 17:33:02 +02:00
parent 9a10e3cd35
commit ca25e62e35
2 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class GASLoginView(LoginView):
class GASPasswordChangeView(GASMixin, PasswordChangeView): class GASPasswordChangeView(GASMixin, PasswordChangeView):
template_name = 'gas/base_form.html' template_name = 'gas/base_form.html'
success_url = reverse_lazy('gas:index') success_url = reverse_lazy('gas:index')
continue_url = reverse_lazy('gas:change_password')
title = _('Change your password') title = _('Change your password')
success_message = _('Password changed.') success_message = _('Password changed.')

View File

@ -75,6 +75,9 @@ class ChangePasswordUser(BaseMixin, gviews.GASMixin, FormView):
def get_title(self): def get_title(self):
return _('Change {username} user password').format(username=self.user.username) 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): def get_form_kwargs(self):
kwargs = super().get_form_kwargs() kwargs = super().get_form_kwargs()
kwargs['user'] = self.user kwargs['user'] = self.user