mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
AC-1181 Fixed job serializer to copy default name/description from job template.
This commit is contained in:
parent
1b242926e9
commit
55da67fa91
@ -1262,7 +1262,8 @@ class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):
|
|||||||
except JobTemplate.DoesNotExist:
|
except JobTemplate.DoesNotExist:
|
||||||
self._errors = {'job_template': 'Invalid job template'}
|
self._errors = {'job_template': 'Invalid job template'}
|
||||||
return
|
return
|
||||||
# Don't auto-populate name or description.
|
data.setdefault('name', job_template.name)
|
||||||
|
data.setdefault('description', job_template.description)
|
||||||
data.setdefault('job_type', job_template.job_type)
|
data.setdefault('job_type', job_template.job_type)
|
||||||
if job_template.inventory:
|
if job_template.inventory:
|
||||||
data.setdefault('inventory', job_template.inventory.pk)
|
data.setdefault('inventory', job_template.inventory.pk)
|
||||||
|
@ -627,7 +627,6 @@ class JobTemplateTest(BaseJobTestMixin, django.test.TestCase):
|
|||||||
jt = self.jt_eng_run
|
jt = self.jt_eng_run
|
||||||
url = reverse('api:job_template_jobs_list', args=(jt.pk,))
|
url = reverse('api:job_template_jobs_list', args=(jt.pk,))
|
||||||
data = dict(
|
data = dict(
|
||||||
name='new job from template',
|
|
||||||
credential=self.cred_bob.pk,
|
credential=self.cred_bob.pk,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user