summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorFlavio Curella <89607+fcurella@users.noreply.github.com>2024-07-23 09:36:26 -0500
committerGitHub <noreply@github.com>2024-07-23 11:36:26 -0300
commitf9bf616597d56deac66d9d6bb753b028dd9634cc (patch)
treede2757c22240de6c4428b880ec5a8ec326e076fc /django/db/models/sql/query.py
parentfb7be022cb44d8faec52f17042fa58e4c9f02daf (diff)
Fixed #35585 -- Corrected Query.exists() call in Query.has_results().
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index f00eb1e5a5..9a57af2bf3 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -650,13 +650,13 @@ class Query(BaseExpression):
for combined_query in q.combined_queries
)
q.clear_ordering(force=True)
- if limit:
+ if limit is True:
q.set_limits(high=1)
q.add_annotation(Value(1), "a")
return q
def has_results(self, using):
- q = self.exists(using)
+ q = self.exists()
compiler = q.get_compiler(using=using)
return compiler.has_results()