Skip to content

Commit

Permalink
[#559] Improvements according to PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
vaszig committed May 16, 2022
1 parent ce07fab commit 6e250d2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/open_inwoner/accounts/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@

class LogPasswordChangeView(LogMixin, PasswordChangeView):
def form_valid(self, form):
object = form.save()
response = super().form_valid(form)

object = self.request.user
self.log_user_action(object, _("password was changed"))
# Updating the password logs out all other sessions for the user
# except the current one.
update_session_auth_hash(self.request, form.user)
return super().form_valid(form)
return response


class LogPasswordResetView(LogMixin, PasswordResetView):
Expand All @@ -28,8 +27,8 @@ def form_valid(self, form):

class LogPasswordResetConfirmView(LogMixin, PasswordResetConfirmView):
def form_valid(self, form):
super().form_valid(form)
object = self.get_user(self.kwargs["uidb64"])
response = super().form_valid(form)

object = self.get_user(self.kwargs["uidb64"])
self.log_system_action(_("password reset was completed"), object)
return HttpResponseRedirect(self.get_success_url())
return response

0 comments on commit 6e250d2

Please sign in to comment.