Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SearchFilter.must_call_distinict for annotation+m2m #7146

Merged
merged 2 commits into from May 11, 2020

Conversation

rpkilby
Copy link
Member

@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
Member

@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.

@tomchristie
Copy link
Member

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

@tomchristie tomchristie 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.

None yet

3 participants