Skip to content

Commit cf51306

Browse files
committed
Ensure results are distinct when applying a filter, there may be n:m relations around
1 parent dd073f8 commit cf51306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

feincms3_data/data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def specs_for_app_models(app, spec=None):
8181
def _model_queryset(spec):
8282
queryset = apps.get_model(spec["model"])._default_manager.order_by("pk")
8383
if f := spec.get("filter"):
84-
queryset = queryset.filter(**f)
84+
queryset = queryset.filter(**f).distinct()
8585
return queryset
8686

8787

0 commit comments

Comments
 (0)