diff --git a/brutaldon/templates/polls/new_partial.html b/brutaldon/templates/polls/new_partial.html index 719d174..3575718 100644 --- a/brutaldon/templates/polls/new_partial.html +++ b/brutaldon/templates/polls/new_partial.html @@ -2,7 +2,11 @@ {% load taglinks %} {% load static %} -
+ {% csrf_token %} {% for option in toot.poll.options %}
@@ -24,4 +28,7 @@
{% endfor %} + +
diff --git a/brutaldon/views.py b/brutaldon/views.py index 066cb35..abc1906 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -1635,4 +1635,10 @@ def vote(request, id): values = [x for x in request.POST.getlist('poll-multiple')] if values: mastodon.poll_vote(poll.id, values) - return redirect("thread", id) + + if request.POST.get("ic-request"): + return render(request, + "main/toot_partial.html", + {"toot": mastodon.status(id) }) + else: + return redirect("thread", id)