From d4dba8c1ad4ddc668af52f691974f8343b95d86d Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Sat, 19 Nov 2016 14:02:29 +0000 Subject: [PATCH] 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 --- patchwork/forms.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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 -- 2.47.3