From b1b9fdede503f7f67e2c90307ec2236f303f9100 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 10 Dec 2014 10:40:48 -0500 Subject: [PATCH] Fix a bug where, when launching a job without a credential and subsequently supplying the credential we weren't able to pick up any ASK fields that we needed credentials for --- awx/api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index a3c334d9c1..95fc634e7b 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -1483,7 +1483,8 @@ class JobTemplateLaunch(GenericAPIView): new_job = obj.create_unified_job(**request.DATA) result = new_job.signal_start(**request.DATA) if not result: - data = dict(passwords_needed_to_start=obj.passwords_needed_to_start) + data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start) + # TODO, this scenario leaves an orphaned "new" job. Should we delete it? return Response(data, status=status.HTTP_400_BAD_REQUEST) else: data = dict(job=new_job.id)