From 5b7d4e0b68a940b2e6f0070b3a6461f4020c9109 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Wed, 10 Jul 2019 13:25:53 -0400 Subject: [PATCH] Polls work with intercooler --- brutaldon/templates/polls/new_partial.html | 9 ++++++++- brutaldon/views.py | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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)