mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
run host listing through v1 vs. v2 logic
* api/v1/hosts related fields were getting v2 in the related urls. The context is now included in the serializer instantiation.
This commit is contained in:
parent
4b537870b4
commit
775093294e
@ -1714,8 +1714,8 @@ class HostList(ListCreateAPIView):
|
||||
try:
|
||||
queryset = self.get_queryset()
|
||||
except Exception as e:
|
||||
return Response(dict(error=_(unicode(e))), status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response(dict(results=self.serializer_class(queryset, many=True).data))
|
||||
return Response(dict(error=_(unicode(e))), context=self.get_serializer_context(), status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response(dict(results=self.serializer_class(queryset, many=True, context=self.get_serializer_context()).data))
|
||||
|
||||
|
||||
class HostDetail(RetrieveUpdateDestroyAPIView):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user