mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 23:43:47 +00:00
Cleanup old Request objects in process_passwd and process_email
This commit is contained in:
parent
227511504e
commit
cb1784142f
1 changed files with 4 additions and 2 deletions
|
@ -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"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue