8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:22:26 +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 Jean-Romain Garnier
parent 227511504e
commit cb1784142f

View file

@ -1027,7 +1027,8 @@ def process_passwd(request, req):
u_form.save() u_form.save()
reversion.set_comment("Password reset") 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.")) messages.success(request, _("The password was changed."))
return redirect(reverse("index")) return redirect(reverse("index"))
return form( return form(
@ -1047,7 +1048,8 @@ def process_email(request, req):
user.save() user.save()
reversion.set_comment("Email confirmation") 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)) messages.success(request, _("The %s address was confirmed." % user.email))
return redirect(reverse("index")) return redirect(reverse("index"))