From c67ea79aa981ae82595d89f8018a41fcd842e7c9 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Sun, 26 Feb 2023 13:43:00 +0100 Subject: Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer window expression. Regression in f387d024fc75569d2a4a338bfda76cc2f328f627. Co-authored-by: Jannis Vajen --- django/db/models/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql') diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index e1a240dec3..07393e7605 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -676,7 +676,7 @@ class SQLCompiler: ) ) inner_query_compiler = inner_query.get_compiler( - self.using, elide_empty=self.elide_empty + self.using, connection=self.connection, elide_empty=self.elide_empty ) inner_sql, inner_params = inner_query_compiler.as_sql( # The limits must be applied to the outer query to avoid pruning -- cgit v1.3