Cleaning up with black, isort, flake8.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-01-16 07:37:21 -05:00
parent ab7387acd8
commit 9523cc1d97
28 changed files with 82 additions and 61 deletions

View File

@@ -77,7 +77,10 @@ def process_ses_results(self, response):
f"SES bounce for notification ID {notification.id}: {bounce_message}"
)
if notification.status not in {NotificationStatus.SENDING, NotificationStatus.PENDING}:
if notification.status not in {
NotificationStatus.SENDING,
NotificationStatus.PENDING,
}:
notifications_dao._duplicate_update_warning(
notification, notification_status
)

View File

@@ -121,7 +121,8 @@ def deliver_sms(self, notification_id):
)
except Exception as e:
update_notification_status_by_id(
notification_id, NotificationStatus.TEMPORARY_FAILURE,
notification_id,
NotificationStatus.TEMPORARY_FAILURE,
)
if isinstance(e, SmsClientResponseException):
current_app.logger.warning(
@@ -146,7 +147,8 @@ def deliver_sms(self, notification_id):
)
)
update_notification_status_by_id(
notification_id, NotificationStatus.TECHNICAL_FAILURE,
notification_id,
NotificationStatus.TECHNICAL_FAILURE,
)
raise NotificationTechnicalFailureException(message)
@@ -189,6 +191,7 @@ def deliver_email(self, notification_id):
)
)
update_notification_status_by_id(
notification_id, NotificationStatus.TECHNICAL_FAILURE,
notification_id,
NotificationStatus.TECHNICAL_FAILURE,
)
raise NotificationTechnicalFailureException(message)

View File

@@ -34,7 +34,7 @@ from app.dao.services_dao import (
)
from app.dao.users_dao import delete_codes_older_created_more_than_a_day_ago
from app.delivery.send_to_providers import provider_to_use
from app.enums import NotificationType, JobStatus
from app.enums import JobStatus, NotificationType
from app.models import Job
from app.notifications.process_notifications import send_notification_to_queue

View File

@@ -20,7 +20,7 @@ from app.dao.service_email_reply_to_dao import dao_get_reply_to_by_id
from app.dao.service_inbound_api_dao import get_service_inbound_api_for_service
from app.dao.service_sms_sender_dao import dao_get_service_sms_senders_by_id
from app.dao.templates_dao import dao_get_template_by_id
from app.enums import NotificationType, JobStatus, KeyType
from app.enums import JobStatus, KeyType, NotificationType
from app.notifications.process_notifications import persist_notification
from app.notifications.validators import check_service_over_total_message_limit
from app.serialised_models import SerialisedService, SerialisedTemplate