mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 03:01:06 -03:30
filter out duplicate entires for the ActivityStream m2m relations
This commit is contained in:
@@ -2617,7 +2617,7 @@ class ActivityStreamSerializer(BaseSerializer):
|
|||||||
for fk, _ in SUMMARIZABLE_FK_FIELDS.items():
|
for fk, _ in SUMMARIZABLE_FK_FIELDS.items():
|
||||||
if not hasattr(obj, fk):
|
if not hasattr(obj, fk):
|
||||||
continue
|
continue
|
||||||
allm2m = getattr(obj, fk).all()
|
allm2m = getattr(obj, fk).distinct()
|
||||||
if allm2m.count() > 0:
|
if allm2m.count() > 0:
|
||||||
rel[fk] = []
|
rel[fk] = []
|
||||||
for thisItem in allm2m:
|
for thisItem in allm2m:
|
||||||
@@ -2632,7 +2632,7 @@ class ActivityStreamSerializer(BaseSerializer):
|
|||||||
try:
|
try:
|
||||||
if not hasattr(obj, fk):
|
if not hasattr(obj, fk):
|
||||||
continue
|
continue
|
||||||
allm2m = getattr(obj, fk).all()
|
allm2m = getattr(obj, fk).distinct()
|
||||||
if allm2m.count() > 0:
|
if allm2m.count() > 0:
|
||||||
summary_fields[fk] = []
|
summary_fields[fk] = []
|
||||||
for thisItem in allm2m:
|
for thisItem in allm2m:
|
||||||
|
|||||||
Reference in New Issue
Block a user