summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2025-04-04 10:18:27 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2025-04-05 20:43:50 +0200
commit12b771a1ec4bbfe82405176f5601e6441855a303 (patch)
tree1006ad09df611986c0feadba2b5d9747f88b7622 /django/db/models/sql
parent25f97e7bcf2e5064258e07b970b4bdef5fddce51 (diff)
Fixed #36299 -- Prevented field selection on QuerySet.alias() after values().
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a. Refs #28900. Thanks Jeff Iadarola for the report and tests. Co-Authored-By: OutOfFocus4 <jeff.iadarola@gmail.com>
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 9fde8496e9..4d31c36175 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1221,7 +1221,7 @@ class Query(BaseExpression):
else:
self.set_annotation_mask(set(self.annotation_select).difference({alias}))
self.annotations[alias] = annotation
- if self.selected:
+ if select and self.selected:
self.selected[alias] = alias
@property