Skip to content

Commit

Permalink
Join across the InstanceLink.target to the underlying Instance
Browse files Browse the repository at this point in the history
to avoid having to do a lookup for every instance in the list for the
mesh visualizer endpoint.
  • Loading branch information
jbradberry committed Jan 16, 2024
1 parent 08c2d8c commit 448bc06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awx/api/views/mesh_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MeshVisualizer(APIView):
def get(self, request, format=None):
data = {
'nodes': InstanceNodeSerializer(Instance.objects.all(), many=True).data,
'links': InstanceLinkSerializer(InstanceLink.objects.select_related('target', 'source'), many=True).data,
'links': InstanceLinkSerializer(InstanceLink.objects.select_related('target__instance', 'source'), many=True).data,
}

return Response(data)

0 comments on commit 448bc06

Please sign in to comment.