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

@@ -200,13 +200,13 @@ class ClusterAddDevicesForm(BootstrapMixin, ChainedFieldsMixin, forms.Form):
self.cluster = cluster
super(ClusterAddDevicesForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.fields['devices'].choices = []
def clean(self):
super(ClusterAddDevicesForm, self).clean()
super().clean()
# If the Cluster is assigned to a Site, all Devices must be assigned to that Site.
if self.cluster.site is not None:
@@ -266,7 +266,7 @@ class VirtualMachineForm(BootstrapMixin, TenancyForm, CustomFieldForm):
initial['cluster_group'] = instance.cluster.group
kwargs['initial'] = initial
super(VirtualMachineForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
if self.instance.pk:
@@ -443,7 +443,7 @@ class InterfaceForm(BootstrapMixin, forms.ModelForm):
def clean(self):
super(InterfaceForm, self).clean()
super().clean()
# Validate VLAN assignments
tagged_vlans = self.cleaned_data['tagged_vlans']
@@ -474,7 +474,7 @@ class InterfaceCreateForm(ComponentForm):
kwargs['initial'] = kwargs.get('initial', {}).copy()
kwargs['initial'].update({'enabled': True})
super(InterfaceCreateForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
class InterfaceBulkEditForm(BootstrapMixin, BulkEditForm):

View File

@@ -13,7 +13,7 @@ class ClusterTypeTest(APITestCase):
def setUp(self):
super(ClusterTypeTest, self).setUp()
super().setUp()
self.clustertype1 = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1')
self.clustertype2 = ClusterType.objects.create(name='Test Cluster Type 2', slug='test-cluster-type-2')
@@ -114,7 +114,7 @@ class ClusterGroupTest(APITestCase):
def setUp(self):
super(ClusterGroupTest, self).setUp()
super().setUp()
self.clustergroup1 = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1')
self.clustergroup2 = ClusterGroup.objects.create(name='Test Cluster Group 2', slug='test-cluster-group-2')
@@ -215,7 +215,7 @@ class ClusterTest(APITestCase):
def setUp(self):
super(ClusterTest, self).setUp()
super().setUp()
cluster_type = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1')
cluster_group = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1')
@@ -328,7 +328,7 @@ class VirtualMachineTest(APITestCase):
def setUp(self):
super(VirtualMachineTest, self).setUp()
super().setUp()
cluster_type = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1')
cluster_group = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1')
@@ -458,7 +458,7 @@ class InterfaceTest(APITestCase):
def setUp(self):
super(InterfaceTest, self).setUp()
super().setUp()
clustertype = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1')
cluster = Cluster.objects.create(name='Test Cluster 1', type=clustertype)