diff --git a/pay-api/src/pay_api/models/payment.py b/pay-api/src/pay_api/models/payment.py index 9bad90aba..1b0452570 100644 --- a/pay-api/src/pay_api/models/payment.py +++ b/pay-api/src/pay_api/models/payment.py @@ -381,7 +381,7 @@ def get_count(cls, auth_account_id: str, search_filter: Dict): """Slimmed downed version for count (less joins).""" query = db.session.query(Invoice.id) query = cls.filter(query, auth_account_id, search_filter, include_joins=True) - count = query.group_by(Invoice.id).with_entities(func.count()).count() # pylint:disable=not-callable + count = query.group_by(Invoice.id).count() return count @classmethod @@ -517,7 +517,6 @@ def generate_subquery(cls, auth_account_id, search_filter, limit, page): subquery = db.session.query(Invoice.id) subquery = ( cls.filter(subquery, auth_account_id, search_filter, include_joins=True) - .with_entities(Invoice.id) .group_by(Invoice.id) .order_by(Invoice.id.desc()) )