Forcing POST urls for votes

This commit is contained in:
Sam Splunks 2024-12-06 10:16:14 +00:00
parent a2bf156d59
commit 5ae1c1fdcb

View File

@ -61,6 +61,7 @@ def category_iframe(request, slug):
def vote(request, item, vote): def vote(request, item, vote):
item = get_object_or_404(KBItem, pk=item) item = get_object_or_404(KBItem, pk=item)
if request.method == "POST":
if vote == 'up': if vote == 'up':
if not item.voted_by.filter(pk=request.user.pk): if not item.voted_by.filter(pk=request.user.pk):
item.votes += 1 item.votes += 1