X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/99f6dd4f1ff0390de9a9bbd4e3352b953cb9a235..062a80b51a89bf2361930461c0ad7ae5e36a2bdd:/apps/polls/templatetags/polls_tags.py diff --git a/apps/polls/templatetags/polls_tags.py b/apps/polls/templatetags/polls_tags.py index d17d30956..fffa78056 100644 --- a/apps/polls/templatetags/polls_tags.py +++ b/apps/polls/templatetags/polls_tags.py @@ -8,15 +8,15 @@ from ..forms import PollForm register = template.Library() -@register.inclusion_tag('polls/tags/poll.html', takes_context = True) -def poll(context, poll, show_results = True, redirect_to = ''): +@register.inclusion_tag('polls/tags/poll.html', takes_context=True) +def poll(context, poll, show_results=True, redirect_to=''): form = None voted_already = poll.voted(context.get('request').session) if not voted_already: - form = PollForm(poll = poll, initial = dict(redirect_to = redirect_to)) - return dict(poll = poll, - form = form, - voted_already = voted_already, - vote_count = poll.vote_count, - show_results = show_results + form = PollForm(poll=poll, initial=dict(redirect_to=redirect_to)) + return dict(poll=poll, + form=form, + voted_already=voted_already, + vote_count=poll.vote_count, + show_results=show_results )