This commit is contained in:
Zhao-Linux 2022-11-17 16:09:28 +07:00
parent b75a52fe74
commit 7174fc1066
2 changed files with 1 additions and 5 deletions

View file

@ -71,10 +71,6 @@ def vote_page(request, delta):
except PageVoteVoter.DoesNotExist: except PageVoteVoter.DoesNotExist:
# We must continue racing in case this is exploited to manipulate votes. # We must continue racing in case this is exploited to manipulate votes.
continue continue
if -vote.score != delta:
return HttpResponseBadRequest(
_("You already voted."), content_type="text/plain"
)
vote.delete() vote.delete()
PageVote.objects.filter(id=pagevote_id).update( PageVote.objects.filter(id=pagevote_id).update(
score=F("score") - vote.score score=F("score") - vote.score

View file

@ -18,7 +18,7 @@
</script> </script>
{% include "contest/media-js.html" %} {% include "contest/media-js.html" %}
{% include "comments/media-js.html" %} {% include "comments/media-js.html" %}
{% include "actionbar/media-css.html" %} {% include "actionbar/media-js.html" %}
{% endblock %} {% endblock %}
{% block content_media %} {% block content_media %}