Skip to content

Commit

Permalink
🐛 [BUG] Prevent objects from being returned several times in APIv2 by…
Browse files Browse the repository at this point in the history
… filtering on ManyToMany (refs #4448)
  • Loading branch information
Chatewgne committed Jan 13, 2025
1 parent c0de8ff commit 13e6a23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ CHANGELOG
- Move Treks' accessibility pictures into the attached files tab (refs #2967)
- Removes the display of an object's structure in its properties tab title

**Bug fixes**

- Prevent objects from being returned several times in APIv2 by filtering on ManyToMany (#4448)

**Documentation**

- Update theme color
Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/v2/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def filter_queryset(self, request, queryset, view):
Q(name__icontains=q) | Q(description__icontains=q)
| Q(description_teaser__icontains=q) | Q(ambiance__icontains=q)
)
return qs
return qs.distinct()

def get_schema_fields(self, view):
return (
Expand Down

0 comments on commit 13e6a23

Please sign in to comment.