mirror of
https://github.com/django/django.git
synced 2025-03-24 16:20:46 +00:00
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 9f3cce172f6913c5ac74272fa5fc07f847b4e112.
This commit is contained in:
parent
604df4e0ad
commit
0f3e1a54bf
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user