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

Remove legacy connected endpoint fields

This commit is contained in:
Jeremy Stretch
2020-10-05 09:56:46 -04:00
parent f8800b8303
commit 079c42291c
13 changed files with 190 additions and 263 deletions

View File

@@ -1122,10 +1122,8 @@ class DeviceLLDPNeighborsView(ObjectView):
def get(self, request, pk):
device = get_object_or_404(self.queryset, pk=pk)
interfaces = device.vc_interfaces.restrict(request.user, 'view').exclude(
interfaces = device.vc_interfaces.restrict(request.user, 'view').prefetch_related('_path').exclude(
type__in=NONCONNECTABLE_IFACE_TYPES
).prefetch_related(
'_connected_interface__device'
)
return render(request, 'dcim/device_lldp_neighbors.html', {
@@ -1483,8 +1481,6 @@ class InterfaceView(ObjectView):
return render(request, 'dcim/interface.html', {
'instance': interface,
'connected_interface': interface._connected_interface,
'connected_circuittermination': interface._connected_circuittermination,
'ipaddress_table': ipaddress_table,
'vlan_table': vlan_table,
})
@@ -2137,7 +2133,7 @@ class InterfaceConnectionsListView(ObjectListView):
).filter(
# Avoid duplicate connections by only selecting the lower PK in a connected pair
_path__isnull=False,
pk__lt=F('_connected_interface')
pk__lt=F('_path__destination_id')
).order_by('device')
filterset = filters.InterfaceConnectionFilterSet
filterset_form = forms.InterfaceConnectionFilterForm