From e36335f68c0abf1ee17d4726b03a92b2a3331115 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 19 Nov 2018 09:28:32 -0500 Subject: [PATCH] only send activity stream create for registered unified jobs see https://github.com/ansible/awx/issues/2733 --- awx/main/models/unified_jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 8fee1fd209..3f041f8b33 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -37,6 +37,7 @@ from awx.main.models.base import ( prevent_search ) from awx.main.dispatch.control import Control as ControlDispatcher +from awx.main.registrar import activity_stream_registrar from awx.main.models.mixins import ResourceMixin, TaskManagerUnifiedJobMixin from awx.main.utils import ( encrypt_dict, decrypt_field, _inventory_updates, @@ -403,8 +404,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio # manually issue the create activity stream entry _after_ M2M relations # have been associated to the UJ - from awx.main.models import SystemJob - if not isinstance(unified_job, SystemJob): + if unified_job.__class__ in activity_stream_registrar.models: activity_stream_create(None, unified_job, True) return unified_job