From 8509a43b955ec64dad16762917ed3cdaae3d7d8d Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 7 Jun 2018 13:34:58 -0400 Subject: [PATCH] exclude m2m copies from activity stream --- awx/api/generics.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/api/generics.py b/awx/api/generics.py index b0155e1429..1bbed0a825 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -909,9 +909,11 @@ class CopyAPIView(GenericAPIView): # not work properly in non-request-response-cycle context. new_obj.created_by = creater new_obj.save() - for m2m in m2m_to_preserve: - for related_obj in m2m_to_preserve[m2m].all(): - getattr(new_obj, m2m).add(related_obj) + from awx.main.signals import disable_activity_stream + with disable_activity_stream(): + for m2m in m2m_to_preserve: + for related_obj in m2m_to_preserve[m2m].all(): + getattr(new_obj, m2m).add(related_obj) if not old_parent: sub_objects = [] for o2m in o2m_to_preserve: