Fix an issue that would not allow credential to be posted when launching

a job
This commit is contained in:
Matthew Jones
2014-12-17 21:09:51 -05:00
parent be2f2596f3
commit 6f5d450e8d
2 changed files with 3 additions and 1 deletions

View File

@@ -1493,7 +1493,7 @@ class JobTemplateLaunch(GenericAPIView):
status=status.HTTP_400_BAD_REQUEST)
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)
new_job = obj.create_unified_job()
new_job = obj.create_unified_job(**request.DATA)
result = new_job.signal_start(**request.DATA)
if not result:
data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start)

View File

@@ -290,6 +290,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique):
unified_job_class = self._get_unified_job_class()
parent_field_name = unified_job_class._get_parent_field_name()
kwargs.pop('%s_id' % parent_field_name, None)
if 'extra_vars' in kwargs:
kwargs.pop('extra_vars')
create_kwargs = {}
create_kwargs[parent_field_name] = self
for field_name in self._get_unified_job_field_names():