Verified Commit 81fcf411 authored by Sli's avatar Sli
Browse files

django2.2: forms fixs for new API

parent d7075eb7
......@@ -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")),
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment