mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #25081 -- Prevented DISTINCT ON ordering from being cleared in get().
Thanks to pdewacht for the patch.
This commit is contained in:
parent
7b6d3104f2
commit
07577a2d05
2 changed files with 9 additions and 1 deletions
|
@ -376,7 +376,7 @@ class QuerySet(object):
|
|||
keyword arguments.
|
||||
"""
|
||||
clone = self.filter(*args, **kwargs)
|
||||
if self.query.can_filter():
|
||||
if self.query.can_filter() and not self.query.distinct_fields:
|
||||
clone = clone.order_by()
|
||||
num = len(clone)
|
||||
if num == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue