diff options
| author | Simon Charette <charette.s@gmail.com> | 2015-07-09 13:52:32 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2015-07-09 16:00:52 -0400 |
| commit | 07577a2d05fc33ebef062f97a754dd53079356db (patch) | |
| tree | 2d1a1a1b13c8e6707b8faf775131aab1194132ae /django | |
| parent | 7b6d3104f263d9483982928604b2e51f06126ec1 (diff) | |
Fixed #25081 -- Prevented DISTINCT ON ordering from being cleared in get().
Thanks to pdewacht for the patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index 1484d9dca9..96ecdbc1f4 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -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: |
