From 8b73c097bce542639d8da7b90b6bee2894202149 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Thu, 14 Sep 2023 14:02:33 +0200 Subject: [PATCH] Fix related names of NetmapView --- python/nav/netmap/topology.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/nav/netmap/topology.py b/python/nav/netmap/topology.py index f35492fefb..448fb1bd62 100644 --- a/python/nav/netmap/topology.py +++ b/python/nav/netmap/topology.py @@ -39,7 +39,6 @@ def _get_vlans_map_layer2(graph): for swpv in SwPortVlan.objects.filter( interface__in=list(interface_id_list) ).select_related(): - vlan_by_interface[swpv.interface].append(swpv) # unique storing on internal nav vlan id @@ -136,7 +135,7 @@ def build_netmap_layer2_graph( _logger.debug("build_netmap_layer2_graph() vlan metadata for _nodes_ done") if view: - saved_views = view.node_position_set.all() + saved_views = view.node_positions.all() netmap_graph = _attach_node_positions(netmap_graph, saved_views) _logger.debug("build_netmap_layer2_graph() view positions and graph done") @@ -161,7 +160,6 @@ def build_netmap_layer3_graph(topology_without_metadata, load_traffic=False, vie # Make a copy of the graph, and add edge meta data graph = nx.Graph() for gwpp_u, gwpp_v, prefix in topology_without_metadata.edges(keys=True): - netbox_u = gwpp_u.interface.netbox netbox_v = gwpp_v.interface.netbox @@ -191,7 +189,7 @@ def build_netmap_layer3_graph(topology_without_metadata, load_traffic=False, vie metadata[gwpp_u.prefix.vlan.id].append(additional_metadata) if view: - graph = _attach_node_positions(graph, view.node_position_set.all()) + graph = _attach_node_positions(graph, view.node_positions.all()) _logger.debug("build_netmap_layer3_graph() view positions and graph done") return graph