Explorar o código

Remove descriptions from interface connections list

Jeremy Stretch %!s(int64=5) %!d(string=hai) anos
pai
achega
51ccbdf6c4
Modificáronse 2 ficheiros con 2 adicións e 14 borrados
  1. 1 9
      netbox/dcim/tables.py
  2. 1 5
      netbox/dcim/views.py

+ 1 - 9
netbox/dcim/tables.py

@@ -1153,10 +1153,6 @@ class InterfaceConnectionTable(BaseTable):
         args=[Accessor('pk')],
         args=[Accessor('pk')],
         verbose_name='Interface A'
         verbose_name='Interface A'
     )
     )
-    description_a = tables.Column(
-        accessor=Accessor('description'),
-        verbose_name='Description'
-    )
     device_b = tables.LinkColumn(
     device_b = tables.LinkColumn(
         viewname='dcim:device',
         viewname='dcim:device',
         accessor=Accessor('_connected_interface.device'),
         accessor=Accessor('_connected_interface.device'),
@@ -1169,15 +1165,11 @@ class InterfaceConnectionTable(BaseTable):
         args=[Accessor('_connected_interface.pk')],
         args=[Accessor('_connected_interface.pk')],
         verbose_name='Interface B'
         verbose_name='Interface B'
     )
     )
-    description_b = tables.Column(
-        accessor=Accessor('_connected_interface.description'),
-        verbose_name='Description'
-    )
 
 
     class Meta(BaseTable.Meta):
     class Meta(BaseTable.Meta):
         model = Interface
         model = Interface
         fields = (
         fields = (
-            'device_a', 'interface_a', 'description_a', 'device_b', 'interface_b', 'description_b', 'connection_status',
+            'device_a', 'interface_a', 'device_b', 'interface_b', 'connection_status',
         )
         )
 
 
 
 

+ 1 - 5
netbox/dcim/views.py

@@ -2278,19 +2278,15 @@ class InterfaceConnectionsListView(PermissionRequiredMixin, ObjectListView):
         csv_data = [
         csv_data = [
             # Headers
             # Headers
             ','.join([
             ','.join([
-                'device_a', 'interface_a', 'interface_a_description',
-                'device_b', 'interface_b', 'interface_b_description',
-                'connection_status'
+                'device_a', 'interface_a', 'device_b', 'interface_b', 'connection_status'
             ])
             ])
         ]
         ]
         for obj in self.queryset:
         for obj in self.queryset:
             csv = csv_format([
             csv = csv_format([
                 obj.connected_endpoint.device.identifier if obj.connected_endpoint else None,
                 obj.connected_endpoint.device.identifier if obj.connected_endpoint else None,
                 obj.connected_endpoint.name if obj.connected_endpoint else None,
                 obj.connected_endpoint.name if obj.connected_endpoint else None,
-                obj.connected_endpoint.description if obj.connected_endpoint else None,
                 obj.device.identifier,
                 obj.device.identifier,
                 obj.name,
                 obj.name,
-                obj.description,
                 obj.get_connection_status_display(),
                 obj.get_connection_status_display(),
             ])
             ])
             csv_data.append(csv)
             csv_data.append(csv)