diff --git a/club/forms.py b/club/forms.py index 791cd1fc..4f5d9b85 100644 --- a/club/forms.py +++ b/club/forms.py @@ -66,7 +66,7 @@ class MailingForm(forms.Form): super(MailingForm, self).__init__(*args, **kwargs) self.fields["action"] = forms.TypedChoiceField( - ( + choices=( (self.ACTION_NEW_MAILING, _("New Mailing")), (self.ACTION_NEW_SUBSCRIPTION, _("Subscribe")), (self.ACTION_REMOVE_SUBSCRIPTION, _("Remove")), diff --git a/election/views.py b/election/views.py index a730c011..78342cd2 100644 --- a/election/views.py +++ b/election/views.py @@ -28,23 +28,10 @@ class LimitedCheckboxField(forms.ModelMultipleChoiceField): automatic backend verification """ - def __init__( - self, - queryset, - max_choice, - required=True, - widget=None, - label=None, - initial=None, - help_text="", - *args, - **kwargs - ): + def __init__(self, queryset, max_choice, **kwargs): self.max_choice = max_choice widget = forms.CheckboxSelectMultiple() - super(LimitedCheckboxField, self).__init__( - queryset, None, required, widget, label, initial, help_text, *args, **kwargs - ) + super(LimitedCheckboxField, self).__init__(queryset, **kwargs) def clean(self, value): qs = super(LimitedCheckboxField, self).clean(value)