diff --git a/admin_panel/bd_models/utils.py b/admin_panel/bd_models/utils.py index d7153f4e..677a685f 100644 --- a/admin_panel/bd_models/utils.py +++ b/admin_panel/bd_models/utils.py @@ -6,7 +6,11 @@ class ApproxCountPaginator(Paginator): @cached_property def count(self): - """Return the total number of objects, across all pages.""" + + # if this object isn't empty, then it's a paginator that has been applied filters or search + if self.object_list.query.where.children: # type: ignore + return super().count + with connection.cursor() as cursor: cursor.execute( "SELECT reltuples AS estimate FROM pg_class where relname = "