mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31136 -- Disabled grouping by aliases on QuerySet.values()/values_list().
Regression in fb3f034f1c.
Thanks Sigurd Ljødal for the report.
This commit is contained in:
@@ -2095,7 +2095,9 @@ class Query(BaseExpression):
|
||||
|
||||
if self.group_by is True:
|
||||
self.add_fields((f.attname for f in self.model._meta.concrete_fields), False)
|
||||
self.set_group_by()
|
||||
# Disable GROUP BY aliases to avoid orphaning references to the
|
||||
# SELECT clause which is about to be cleared.
|
||||
self.set_group_by(allow_aliases=False)
|
||||
self.clear_select_fields()
|
||||
|
||||
if fields:
|
||||
|
||||
Reference in New Issue
Block a user