Skip to content

Conversation

@rpkilby
Copy link
Contributor

@rpkilby rpkilby commented Jan 16, 2020

Fixes #6240 (comment). SearchFilter.must_call_distinct incorrectly exits early if it encounters an annotation. Any subsequent m2m fields are ignored instead of causing the method to return true. By continuing, the annotations still bypass the distinct check, and will return false at the end if no m2m fields are encountered.

Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this should be merged for 3.12 release.

@lovelydinosaur
Copy link
Contributor

Fab, thanks @rpkilby - sorry it got missed off for so long!

@lovelydinosaur lovelydinosaur merged commit 8a38991 into encode:master May 11, 2020
@rpkilby rpkilby deleted the fix-search-distinct branch August 6, 2020 01:12
@rpkilby rpkilby added this to the 3.12 Release milestone Aug 6, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
* Test SearchFilter annotation+m2m distinct

* Fix SearchFilter annotation+m2m distinct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants