From 87601cb4308fe5075058900de698d0859ed81140 Mon Sep 17 00:00:00 2001 From: Yuanmao Zhu Date: Tue, 7 Jun 2022 22:53:33 -0400 Subject: [PATCH] Fix `dict` object has no attribut `urls` error in the get nodes endpoint Remove node conversion because we upgraded urls field from deprecated JSON field to django4.0 supported one. Signed-off-by: Yuanmao Zhu --- src/api-engine/api/routes/node/views.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/api-engine/api/routes/node/views.py b/src/api-engine/api/routes/node/views.py index d49f84682..a09c73388 100644 --- a/src/api-engine/api/routes/node/views.py +++ b/src/api-engine/api/routes/node/views.py @@ -120,23 +120,6 @@ def list(self, request, *args, **kwargs): nodes = Node.objects.filter(**query_filter) p = Paginator(nodes, per_page) nodes = p.page(page) - nodes = [ - { - "id": str(node.id), - "name": node.name, - "type": node.type, - "organization": node.organization, - "urls": node.urls, - "network": str(node.organization.network.id) if node.organization.network else None, - "agents": node.agent if node.agent else None, - #"channel": str(node.organization.channel.id) if node.organization.channel else None, - "ports": node.port, - "created_at": node.created_at, - "status": node.status - } - for node in nodes - ] - response = NodeListSerializer({"total": p.count, "data": nodes}) return Response(data=ok(response.data), status=status.HTTP_200_OK) except Exception as e: