From d2fb623283a6b868e6c565f8fc86255de3824986 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Wed, 20 Jul 2022 11:20:14 -0700 Subject: [PATCH] Ejv email fix (#970) * Add in DISABLE_EJV_ERROR_EMAIL. * Default true for now. * Testing library fix. --- queue_services/payment-reconciliations/requirements/dev.txt | 2 +- .../src/reconciliations/cgi_reconciliations.py | 2 +- .../payment-reconciliations/src/reconciliations/config.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/queue_services/payment-reconciliations/requirements/dev.txt b/queue_services/payment-reconciliations/requirements/dev.txt index 23c6ae84c..6c304627f 100755 --- a/queue_services/payment-reconciliations/requirements/dev.txt +++ b/queue_services/payment-reconciliations/requirements/dev.txt @@ -27,5 +27,5 @@ isort # docker lovely-pytest-docker -pytest-asyncio +pytest-asyncio==0.18.3 diff --git a/queue_services/payment-reconciliations/src/reconciliations/cgi_reconciliations.py b/queue_services/payment-reconciliations/src/reconciliations/cgi_reconciliations.py index 243015ce7..c910e9015 100644 --- a/queue_services/payment-reconciliations/src/reconciliations/cgi_reconciliations.py +++ b/queue_services/payment-reconciliations/src/reconciliations/cgi_reconciliations.py @@ -98,7 +98,7 @@ async def _update_feedback(msg: Dict[str, any]): # pylint:disable=too-many-loca has_errors = await _process_ejv_feedback(group_batches['EJV']) has_errors = await _process_ap_feedback(group_batches['AP']) or has_errors - if has_errors: + if has_errors and not APP_CONFIG.DISABLE_EJV_ERROR_EMAIL: await _publish_mailer_events(file_name, minio_location) diff --git a/queue_services/payment-reconciliations/src/reconciliations/config.py b/queue_services/payment-reconciliations/src/reconciliations/config.py index c67bfd8f2..353295495 100644 --- a/queue_services/payment-reconciliations/src/reconciliations/config.py +++ b/queue_services/payment-reconciliations/src/reconciliations/config.py @@ -115,6 +115,9 @@ class _Config(): # pylint: disable=too-few-public-methods # Secret key for encrypting bank account ACCOUNT_SECRET_KEY = os.getenv('ACCOUNT_SECRET_KEY') + # Disable EJV Error Email + DISABLE_EJV_ERROR_EMAIL = os.getenv('DISABLE_EJV_ERROR_EMAIL', 'true').lower() == 'true' + class DevConfig(_Config): # pylint: disable=too-few-public-methods """Creates the Development Config object."""