fixes #5314 - Fix config context rendering when multiple tags are assgined to an object

This commit is contained in:
John Anderson
2020-11-06 16:47:07 -05:00
parent b39019cec9
commit 0d27abc6fc
3 changed files with 38 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ class ConfigContextQuerySet(RestrictedQuerySet):
Q(tenants=obj.tenant) | Q(tenants=None),
Q(tags__slug__in=obj.tags.slugs()) | Q(tags=None),
is_active=True,
).order_by('weight', 'name')
).order_by('weight', 'name').distinct()
if aggregate_data:
return queryset.aggregate(
@@ -95,7 +95,7 @@ class ConfigContextModelQuerySet(RestrictedQuerySet):
_data=EmptyGroupByJSONBAgg('data', ordering=['weight', 'name'])
).values("_data")
)
)
).distinct()
def _get_config_context_filters(self):
# Construct the set of Q objects for the specific object types