Jonathan Senecal 5 лет назад
Родитель
Сommit
e0037c7f70
2 измененных файлов с 10 добавлено и 10 удалено
  1. 7 7
      netbox/dcim/api/serializers.py
  2. 3 3
      netbox/dcim/tests/test_forms.py

+ 7 - 7
netbox/dcim/api/serializers.py

@@ -261,7 +261,7 @@ class ConsoleServerPortTemplateSerializer(ValidatedModelSerializer):
 
     class Meta:
         model = ConsoleServerPortTemplate
-        fields = ['id', 'device_type', 'name', 'label',  'type']
+        fields = ['id', 'device_type', 'name', 'label', 'type']
 
 
 class PowerPortTemplateSerializer(ValidatedModelSerializer):
@@ -274,7 +274,7 @@ class PowerPortTemplateSerializer(ValidatedModelSerializer):
 
     class Meta:
         model = PowerPortTemplate
-        fields = ['id', 'device_type', 'name', 'label',  'type', 'maximum_draw', 'allocated_draw']
+        fields = ['id', 'device_type', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw']
 
 
 class PowerOutletTemplateSerializer(ValidatedModelSerializer):
@@ -295,7 +295,7 @@ class PowerOutletTemplateSerializer(ValidatedModelSerializer):
 
     class Meta:
         model = PowerOutletTemplate
-        fields = ['id', 'device_type', 'name', 'label',  'type', 'power_port', 'feed_leg']
+        fields = ['id', 'device_type', 'name', 'label', 'type', 'power_port', 'feed_leg']
 
 
 class InterfaceTemplateSerializer(ValidatedModelSerializer):
@@ -446,7 +446,7 @@ class ConsoleServerPortSerializer(TaggitSerializer, ConnectedEndpointSerializer)
     class Meta:
         model = ConsoleServerPort
         fields = [
-            'id', 'device', 'name', 'label',  'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
+            'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
             'connection_status', 'cable', 'tags',
         ]
 
@@ -464,7 +464,7 @@ class ConsolePortSerializer(TaggitSerializer, ConnectedEndpointSerializer):
     class Meta:
         model = ConsolePort
         fields = [
-            'id', 'device', 'name', 'label',  'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
+            'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
             'connection_status', 'cable', 'tags',
         ]
 
@@ -494,7 +494,7 @@ class PowerOutletSerializer(TaggitSerializer, ConnectedEndpointSerializer):
     class Meta:
         model = PowerOutlet
         fields = [
-            'id', 'device', 'name', 'label',  'type', 'power_port', 'feed_leg', 'description', 'connected_endpoint_type',
+            'id', 'device', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description', 'connected_endpoint_type',
             'connected_endpoint', 'connection_status', 'cable', 'tags',
         ]
 
@@ -512,7 +512,7 @@ class PowerPortSerializer(TaggitSerializer, ConnectedEndpointSerializer):
     class Meta:
         model = PowerPort
         fields = [
-            'id', 'device', 'name', 'label',  'type', 'maximum_draw', 'allocated_draw', 'description', 'connected_endpoint_type',
+            'id', 'device', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description', 'connected_endpoint_type',
             'connected_endpoint', 'connection_status', 'cable', 'tags',
         ]
 

+ 3 - 3
netbox/dcim/tests/test_forms.py

@@ -133,7 +133,7 @@ class LabelTestCase(TestCase):
         cls.device = Device.objects.create(
             name='Device 2', device_type=cls.device_type, device_role=device_role, site=site
         )
-    
+
     def test_interface_label_count_valid(self):
         good_interface_data = {
             'device': self.device.pk,
@@ -143,7 +143,7 @@ class LabelTestCase(TestCase):
             'type': InterfaceTypeChoices.TYPE_100ME_FIXED,
         }
         form = InterfaceCreateForm(good_interface_data)
-        
+
         print(form.errors)
         self.assertTrue(form.is_valid())
 
@@ -159,7 +159,7 @@ class LabelTestCase(TestCase):
 
         self.assertFalse(form.is_valid())
         self.assertIn('label_pattern', form.errors)
-    
+
     def test_console_port_template_label_count_valid(self):
         bad_console_port_template_data = {
             'device_type': self.device_type,