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

Merge pull request #2738 from ryanpetrello/inv-update-as

don't send activity stream create for unregistered models

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2018-11-19 15:02:33 +00:00 committed by GitHub
commit 01d891cd6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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