From de53e0e6ab8a935ec72652bc8a5c37851e2b4d7b Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Mon, 25 Nov 2024 12:34:15 -0800 Subject: [PATCH] Add in condition for None (#1839) --- jobs/payment-jobs/tasks/ap_task.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobs/payment-jobs/tasks/ap_task.py b/jobs/payment-jobs/tasks/ap_task.py index ac21fd2e8..081ad3d7d 100644 --- a/jobs/payment-jobs/tasks/ap_task.py +++ b/jobs/payment-jobs/tasks/ap_task.py @@ -41,7 +41,7 @@ RoutingSlipStatus, ) from sentry_sdk import capture_message -from sqlalchemy import Date, cast +from sqlalchemy import Date, cast, or_ from tasks.common.cgi_ap import CgiAP from tasks.common.dataclasses import APLine @@ -109,7 +109,8 @@ def _create_eft_refund_file(cls): eft_refunds_dao = ( db.session.query(EFTRefundModel) .filter(EFTRefundModel.status == EFTShortnameRefundStatus.APPROVED.value) - .filter(EFTRefundModel.disbursement_status_code != DisbursementStatus.UPLOADED.value) + .filter(or_(EFTRefundModel.disbursement_status_code != DisbursementStatus.UPLOADED.value, + EFTRefundModel.disbursement_status_code.is_(None))) .filter(EFTRefundModel.refund_amount > 0) .all() )