X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..c79859fc60a6db521c413ab3f3e1b2b3440670e2:/src/polls/forms.py?ds=sidebyside diff --git a/src/polls/forms.py b/src/polls/forms.py index 20d53fe33..ac97354b4 100644 --- a/src/polls/forms.py +++ b/src/polls/forms.py @@ -1,14 +1,13 @@ -# -*- 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 forms - - -class PollForm(forms.Form): - vote = forms.ChoiceField(widget=forms.RadioSelect) - +# 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 forms + + +class PollForm(forms.Form): + vote = forms.ChoiceField(widget=forms.RadioSelect) + def __init__(self, *args, **kwargs): - poll = kwargs.pop('poll', None) - super(PollForm, self).__init__(*args, **kwargs) - self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()] + poll = kwargs.pop('poll', None) + super(PollForm, self).__init__(*args, **kwargs) + self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]