mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Fix an issue that would not allow credential to be posted when launching
a job
This commit is contained in:
@@ -1493,7 +1493,7 @@ class JobTemplateLaunch(GenericAPIView):
|
|||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
if obj.credential is None and ('credential' not in request.DATA and 'credential_id' not in request.DATA):
|
if obj.credential is None and ('credential' not in request.DATA and 'credential_id' not in request.DATA):
|
||||||
return Response(dict(errors="Credential not provided"), status=status.HTTP_400_BAD_REQUEST)
|
return Response(dict(errors="Credential not provided"), status=status.HTTP_400_BAD_REQUEST)
|
||||||
new_job = obj.create_unified_job()
|
new_job = obj.create_unified_job(**request.DATA)
|
||||||
result = new_job.signal_start(**request.DATA)
|
result = new_job.signal_start(**request.DATA)
|
||||||
if not result:
|
if not result:
|
||||||
data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start)
|
data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start)
|
||||||
|
|||||||
@@ -290,6 +290,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique):
|
|||||||
unified_job_class = self._get_unified_job_class()
|
unified_job_class = self._get_unified_job_class()
|
||||||
parent_field_name = unified_job_class._get_parent_field_name()
|
parent_field_name = unified_job_class._get_parent_field_name()
|
||||||
kwargs.pop('%s_id' % parent_field_name, None)
|
kwargs.pop('%s_id' % parent_field_name, None)
|
||||||
|
if 'extra_vars' in kwargs:
|
||||||
|
kwargs.pop('extra_vars')
|
||||||
create_kwargs = {}
|
create_kwargs = {}
|
||||||
create_kwargs[parent_field_name] = self
|
create_kwargs[parent_field_name] = self
|
||||||
for field_name in self._get_unified_job_field_names():
|
for field_name in self._get_unified_job_field_names():
|
||||||
|
|||||||
Reference in New Issue
Block a user