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

Merge pull request #2095 from AlanCoding/memories_of_labels

Exclude m2m copies from activity stream
This commit is contained in:
Alan Rominger 2018-06-07 15:09:27 -04:00 committed by GitHub
commit d969e37f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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