Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dict object has no attribute urls error in the get nodes endpoint #454

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/api-engine/api/routes/node/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down