diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 65ab501913..7bc89d657c 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -675,7 +675,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique fields = unified_jt_class._get_unified_job_field_names() + [parent_field_name] unified_job = copy_model_by_class(self, unified_job_class, fields, {}) - unified_job.job_type = 'relaunch' + unified_job.launch_type = 'relaunch' unified_job.save() # Labels coppied here diff --git a/awx/main/tests/functional/test_jobs.py b/awx/main/tests/functional/test_jobs.py index 63cc62b03b..5169d98fb1 100644 --- a/awx/main/tests/functional/test_jobs.py +++ b/awx/main/tests/functional/test_jobs.py @@ -10,6 +10,8 @@ def test_orphan_unified_job_creation(instance, inventory): assert job2.job_template is None assert job2.inventory == inventory assert job2.name == 'hi world' + assert job.job_type == job2.job_type + assert job2.launch_type == 'relaunch' @pytest.mark.django_db