From cad3c1c3251906684d01f847209e6880de420cee Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Mon, 9 Dec 2024 06:35:23 -0800 Subject: [PATCH] More rollbacks --- pay-api/src/pay_api/models/payment.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pay-api/src/pay_api/models/payment.py b/pay-api/src/pay_api/models/payment.py index 34cab4422..82c9b615b 100644 --- a/pay-api/src/pay_api/models/payment.py +++ b/pay-api/src/pay_api/models/payment.py @@ -341,16 +341,14 @@ def search_purchase_history( # noqa:E501; pylint:disable=too-many-arguments, to # If maximum number of records is provided, set the page with that number sub_query = cls.generate_subquery(auth_account_id, search_filter, max_no_records, page=None) result, count = ( - db.session.query(Invoice) - .from_statement(query.filter(Invoice.id.in_(sub_query.subquery().select()))) - .all(), + query.filter(Invoice.id.in_(sub_query.subquery().select())).all(), sub_query.count(), ) else: count = cls.get_count(auth_account_id, search_filter) if count > 60000: raise BusinessException(Error.PAYMENT_SEARCH_TOO_MANY_RECORDS) - result = db.session.query(Invoice).from_statement(query).all() + result = query.all() return result, count @classmethod