1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

only send activity stream create for registered unified jobs

see https://github.com/ansible/awx/issues/2733
This commit is contained in:
Ryan Petrello 2018-11-19 09:28:32 -05:00
parent 39369c7721
commit e36335f68c
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -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