Skip to content

Commit

Permalink
Fix count
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Dec 8, 2024
1 parent 0231d23 commit c4bfb1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pay-api/src/pay_api/models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
)
Expand Down

0 comments on commit c4bfb1b

Please sign in to comment.