Skip to content

Commit

Permalink
Ensure results are distinct when applying a filter, there may be n:m …
Browse files Browse the repository at this point in the history
…relations around
  • Loading branch information
matthiask committed Jan 14, 2025
1 parent dd073f8 commit cf51306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion feincms3_data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def specs_for_app_models(app, spec=None):
def _model_queryset(spec):
queryset = apps.get_model(spec["model"])._default_manager.order_by("pk")
if f := spec.get("filter"):
queryset = queryset.filter(**f)
queryset = queryset.filter(**f).distinct()
return queryset


Expand Down

0 comments on commit cf51306

Please sign in to comment.