1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #2614: Simplify calls of super() for Python 3

This commit is contained in:
Jeremy Stretch
2018-11-27 10:52:24 -05:00
parent 7d262296e1
commit bd7aee7c1f
46 changed files with 193 additions and 193 deletions

View File

@ -102,7 +102,7 @@ class CustomFieldForm(forms.ModelForm):
self.custom_fields = []
self.obj_type = ContentType.objects.get_for_model(self._meta.model)
super(CustomFieldForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
# Add all applicable CustomFields to the form
custom_fields = []
@ -138,7 +138,7 @@ class CustomFieldForm(forms.ModelForm):
cfv.save()
def save(self, commit=True):
obj = super(CustomFieldForm, self).save(commit)
obj = super().save(commit)
# Handle custom fields the same way we do M2M fields
if commit:
@ -152,7 +152,7 @@ class CustomFieldForm(forms.ModelForm):
class CustomFieldBulkEditForm(BulkEditForm):
def __init__(self, *args, **kwargs):
super(CustomFieldBulkEditForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.custom_fields = []
self.obj_type = ContentType.objects.get_for_model(self.model)
@ -175,7 +175,7 @@ class CustomFieldFilterForm(forms.Form):
self.obj_type = ContentType.objects.get_for_model(self.model)
super(CustomFieldFilterForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
# Add all applicable CustomFields to the form
custom_fields = get_custom_fields_for_model(self.obj_type, filterable_only=True).items()
@ -199,7 +199,7 @@ class TagForm(BootstrapMixin, forms.ModelForm):
class AddRemoveTagsForm(forms.Form):
def __init__(self, *args, **kwargs):
super(AddRemoveTagsForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
# Add add/remove tags fields
self.fields['add_tags'] = TagField(required=False)