summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-10-28 10:43:54 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2025-10-28 11:40:01 -0400
commit43933a1dca07047e95ec990d9289d0212668009e (patch)
tree5e7145a24bd05e1e1af8587f4e442c5343191dea /django/db/models/sql
parent9ba3f74a46d15f9f2f45ad4ef8cdd245a888e58e (diff)
Reverted "Fixed #26434 -- Removed faulty clearing of ordering field when missing from explicit grouping."
This reverts commit ea3a71c2d09f8281d8a50ed20e40e1fb13db5cd9. The implementation was flawed, as self.group_by contains Cols, not aliases.
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 8f9349e7eb..84950d4ec0 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -2346,13 +2346,7 @@ class Query(BaseExpression):
query (not even the model's default).
"""
if not force and (
- self.is_sliced
- or self.distinct_fields
- or self.select_for_update
- or (
- isinstance(self.group_by, tuple)
- and not {*self.order_by, *self.extra_order_by}.issubset(self.group_by)
- )
+ self.is_sliced or self.distinct_fields or self.select_for_update
):
return
self.order_by = ()