From: Stephen Finucane Date: Sat, 19 Nov 2016 14:02:29 +0000 (+0000) Subject: forms: Remove unused args in forms X-Git-Tag: v2.0.0-rc1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4dba8c1ad4ddc668af52f691974f8343b95d86d;p=thirdparty%2Fpatchwork.git forms: Remove unused args in forms There were a couple of forms that offered configurabilty, but this configurability wasn't used anywhere. Simplify things and remove any related code. Signed-off-by: Stephen Finucane --- diff --git a/patchwork/forms.py b/patchwork/forms.py index 54bb02a5..b8865b64 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -137,12 +137,9 @@ class OptionalDelegateField(DelegateField): no_change_choice = ('*', 'no change') to_field_name = None - def __init__(self, no_change_choice=None, *args, **kwargs): - self.filter = None - if (no_change_choice): - self.no_change_choice = no_change_choice - super(OptionalDelegateField, self). \ - __init__(initial=self.no_change_choice[0], *args, **kwargs) + def __init__(self, *args, **kwargs): + super(OptionalDelegateField, self).__init__( + initial=self.no_change_choice[0], *args, **kwargs) def _get_choices(self): choices = list( @@ -165,12 +162,9 @@ class OptionalModelChoiceField(forms.ModelChoiceField): no_change_choice = ('*', 'no change') to_field_name = None - def __init__(self, no_change_choice=None, *args, **kwargs): - self.filter = None - if (no_change_choice): - self.no_change_choice = no_change_choice - super(OptionalModelChoiceField, self). \ - __init__(initial=self.no_change_choice[0], *args, **kwargs) + def __init__(self, *args, **kwargs): + super(OptionalModelChoiceField, self).__init__( + initial=self.no_change_choice[0], *args, **kwargs) def _get_choices(self): # _get_choices queries the database, which can fail if the db