8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 11:53:12 +00:00

Cleanup old Request objects in process_passwd and process_email

This commit is contained in:
Jean-Romain Garnier 2020-04-18 01:03:41 +02:00 committed by Gabriel Detraz
parent 2ed3b2ac31
commit 85836fa770

View file

@ -1027,7 +1027,8 @@ def process_passwd(request, req):
u_form.save()
reversion.set_comment("Password reset")
req.delete()
# Delete all remaining requests
Request.objects.filter(user=user, type=Request.PASSWD).delete()
messages.success(request, _("The password was changed."))
return redirect(reverse("index"))
return form(
@ -1047,7 +1048,8 @@ def process_email(request, req):
user.save()
reversion.set_comment("Email confirmation")
req.delete()
# Delete all remaining requests
Request.objects.filter(user=user, type=Request.EMAIL).delete()
messages.success(request, _("The %s address was confirmed." % user.email))
return redirect(reverse("index"))