diff --git a/clubhaus/homepage/views.py b/clubhaus/homepage/views.py index d3e1ec7..00e198a 100644 --- a/clubhaus/homepage/views.py +++ b/clubhaus/homepage/views.py @@ -90,7 +90,10 @@ def voting(request: HttpRequest) -> django.http.HttpResponse: # handle delete 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")) # handle normal voting