X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/002577cf05a6730e8b1c97d1931d79758cbcbfdc..062a80b51a89bf2361930461c0ad7ae5e36a2bdd:/apps/polls/templatetags/polls_tags.py diff --git a/apps/polls/templatetags/polls_tags.py b/apps/polls/templatetags/polls_tags.py index e69a7ce96..fffa78056 100644 --- a/apps/polls/templatetags/polls_tags.py +++ b/apps/polls/templatetags/polls_tags.py @@ -1,18 +1,22 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import template 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 - ) \ No newline at end of file + 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 + )