mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-04 07:11:48 -05:00
copy organization when copying a WFJT
This commit is contained in:
@@ -79,10 +79,6 @@ class SurveyJobTemplateMixin(models.Model):
|
||||
default={},
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _get_unified_jt_copy_names(cls):
|
||||
return cls._get_unified_job_field_names() + ['survey_spec', 'survey_enabled']
|
||||
|
||||
def survey_password_variables(self):
|
||||
vars = []
|
||||
if self.survey_enabled and 'spec' in self.survey_spec:
|
||||
|
||||
@@ -357,6 +357,10 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio
|
||||
dest_field.add(*list(src_field_value.all().values_list('id', flat=True)))
|
||||
return unified_job
|
||||
|
||||
@classmethod
|
||||
def _get_unified_jt_copy_names(cls):
|
||||
return cls._get_unified_job_field_names()
|
||||
|
||||
def copy_unified_jt(self):
|
||||
'''
|
||||
Create a copy of this unified job template.
|
||||
|
||||
@@ -362,7 +362,13 @@ class WorkflowJobTemplate(UnifiedJobTemplate, WorkflowJobOptions, SurveyJobTempl
|
||||
|
||||
@classmethod
|
||||
def _get_unified_job_field_names(cls):
|
||||
return ['name', 'description', 'extra_vars', 'labels', 'survey_passwords', 'schedule', 'launch_type']
|
||||
return ['name', 'description', 'extra_vars', 'labels', 'survey_passwords',
|
||||
'schedule', 'launch_type']
|
||||
|
||||
@classmethod
|
||||
def _get_unified_jt_copy_names(cls):
|
||||
return (super(WorkflowJobTemplate, cls)._get_unified_jt_copy_names() +
|
||||
['survey_spec', 'survey_enabled', 'organization'])
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('api:workflow_job_template_detail', args=(self.pk,))
|
||||
|
||||
Reference in New Issue
Block a user