summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index b02d19071b..79499b2854 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -513,10 +513,7 @@ class Query(BaseExpression):
"""
obj = self.clone()
obj.add_annotation(Count('*'), alias='__count', is_summary=True)
- number = obj.get_aggregation(using, ['__count'])['__count']
- if number is None:
- number = 0
- return number
+ return obj.get_aggregation(using, ['__count'])['__count']
def has_filters(self):
return self.where