From 5277d30d144446108dccd86f623d368f30d8a618 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Wed, 22 Jun 2016 17:25:27 -0400 Subject: [PATCH] filter out duplicate entires for the ActivityStream m2m relations --- awx/api/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 86167debba..600d39512b 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -2617,7 +2617,7 @@ class ActivityStreamSerializer(BaseSerializer): for fk, _ in SUMMARIZABLE_FK_FIELDS.items(): if not hasattr(obj, fk): continue - allm2m = getattr(obj, fk).all() + allm2m = getattr(obj, fk).distinct() if allm2m.count() > 0: rel[fk] = [] for thisItem in allm2m: @@ -2632,7 +2632,7 @@ class ActivityStreamSerializer(BaseSerializer): try: if not hasattr(obj, fk): continue - allm2m = getattr(obj, fk).all() + allm2m = getattr(obj, fk).distinct() if allm2m.count() > 0: summary_fields[fk] = [] for thisItem in allm2m: