mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
accept inventory_id in workflow launch requests
This commit is contained in:
@@ -3113,6 +3113,9 @@ class WorkflowJobTemplateLaunch(WorkflowsEnforcementMixin, RetrieveAPIView):
|
|||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
|
|
||||||
|
if 'inventory_id' in request.data:
|
||||||
|
request.data['inventory'] = request.data['inventory_id']
|
||||||
|
|
||||||
serializer = self.serializer_class(instance=obj, data=request.data)
|
serializer = self.serializer_class(instance=obj, data=request.data)
|
||||||
if not serializer.is_valid():
|
if not serializer.is_valid():
|
||||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|||||||
Reference in New Issue
Block a user