mirror of
https://github.com/django/django.git
synced 2025-07-28 23:54:02 +00:00
Fixed #15709 - Duplicated group_by condition
Thanks to ziangsong for report, and to mk for the patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@16180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
32bd953e63
commit
385ae343fb
2 changed files with 10 additions and 0 deletions
|
@ -493,7 +493,11 @@ class SQLCompiler(object):
|
|||
params.extend(extra_params)
|
||||
cols = (group_by + self.query.select +
|
||||
self.query.related_select_cols + extra_selects)
|
||||
seen = set()
|
||||
for col in cols:
|
||||
if col in seen:
|
||||
continue
|
||||
seen.add(col)
|
||||
if isinstance(col, (list, tuple)):
|
||||
result.append('%s.%s' % (qn(col[0]), qn(col[1])))
|
||||
elif hasattr(col, 'as_sql'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue