From 37f720ac73fb006db694ba30e62ef7a483a7e890 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 23 Nov 2023 15:38:42 +1000 Subject: [PATCH] Fix bug when listing endpoints for opened project --- gns3server/api/routes/controller/acl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gns3server/api/routes/controller/acl.py b/gns3server/api/routes/controller/acl.py index ea33d46e..ae33bd09 100644 --- a/gns3server/api/routes/controller/acl.py +++ b/gns3server/api/routes/controller/acl.py @@ -99,8 +99,12 @@ async def endpoints( for link in links: node_id_1 = link["nodes"][0]["node_id"] node_id_2 = link["nodes"][1]["node_id"] - node_name_1 = project.nodes[node_id_1]["name"] - node_name_2 = project.nodes[node_id_2]["name"] + node_name_1 = node_name_2 = "N/A" + for node in nodes: + if node["node_id"] == node_id_1: + node_name_1 = node["name"] + if node["node_id"] == node_id_2: + node_name_2 = node["name"] add_to_endpoints( f"/projects/{project.id}/links/{link['link_id']}", f'Link from "{node_name_1}" to "{node_name_2}" in project "{project.name}"',