1
0

Fix voting user delete deletes also entries for past events

This commit is contained in:
Marcel Schwarz 2023-07-25 19:20:49 +02:00
parent d9ad9c1a80
commit 9e0f703434

View File

@ -90,7 +90,10 @@ def voting(request: HttpRequest) -> django.http.HttpResponse:
# handle delete # handle delete
if request.POST["deleteClicked"] == "1": if request.POST["deleteClicked"] == "1":
VotingUser.objects.filter(name=name, modify_key=modify_key).delete() EventDateVote.objects.filter(
date__event__active=True,
voter__name=name,
voter__modify_key=modify_key).delete()
return HttpResponseRedirect(reverse("events")) return HttpResponseRedirect(reverse("events"))
# handle normal voting # handle normal voting