diff options
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index ffd5af6c15..9e54b97374 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -431,7 +431,8 @@ class Query(object): def has_results(self, using): q = self.clone() - q.clear_select_clause() + if not q.distinct: + q.clear_select_clause() q.clear_ordering(True) q.set_limits(high=1) compiler = q.get_compiler(using=using) |
