mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #8819 -- Don't include two copies of extra-select columns in the query.
This was triggered by r8794, but was, in fact, fairly fragile before then. The current fix is the correct way we should be doing this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -630,7 +630,7 @@ class Query(object):
|
||||
else:
|
||||
col, order = get_order_dir(field, asc)
|
||||
elt = qn2(col)
|
||||
if distinct and elt not in select_aliases:
|
||||
if distinct and col not in select_aliases:
|
||||
ordering_aliases.append(elt)
|
||||
result.append('%s %s' % (elt, order))
|
||||
self.ordering_aliases = ordering_aliases
|
||||
|
||||
Reference in New Issue
Block a user