Refs #26430 -- Removed unused branch in sql.Query.get_count().

Now that sql.Query.get_aggregation() properly deals with empty result
sets summary Count() annotations cannot result in None.

Unused since 9f3cce172f.
This commit is contained in:
Simon Charette 2021-10-06 01:25:17 -04:00 committed by GitHub
parent 604df4e0ad
commit 0f3e1a54bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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