mirror of
https://github.com/django/django.git
synced 2025-11-27 13:55:26 +00:00
Fixed #24296 -- Made QuerySet.exists() clear selected columns for not sliced distinct querysets.
This commit is contained in:
parent
d2263b7b87
commit
0ad5316f22
2 changed files with 9 additions and 1 deletions
|
|
@ -562,7 +562,7 @@ class Query(BaseExpression):
|
|||
|
||||
def exists(self, using, limit=True):
|
||||
q = self.clone()
|
||||
if not q.distinct:
|
||||
if not (q.distinct and q.is_sliced):
|
||||
if q.group_by is True:
|
||||
q.add_fields(
|
||||
(f.attname for f in self.model._meta.concrete_fields), False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue