mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
@@ -4,7 +4,6 @@ from datetime import datetime
|
||||
from flask import current_app
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from sqlalchemy.schema import Sequence
|
||||
from celery.exceptions import MaxRetriesExceededError
|
||||
|
||||
from app import cbc_proxy_client, db, notify_celery
|
||||
from app.clients.cbc_proxy import CBCProxyFatalException, CBCProxyRetryableException
|
||||
@@ -57,7 +56,7 @@ def check_provider_message_should_send(broadcast_event, provider):
|
||||
raise CBCProxyFatalException(
|
||||
f'Cannot send broadcast_event {broadcast_event.id} ' +
|
||||
f'to provider {provider}: ' +
|
||||
f'It is already in status technical-failure'
|
||||
'It is already in status technical-failure'
|
||||
)
|
||||
|
||||
if broadcast_event.transmitted_finishes_at < datetime.utcnow():
|
||||
@@ -82,8 +81,8 @@ def check_provider_message_should_send(broadcast_event, provider):
|
||||
raise CBCProxyFatalException(
|
||||
f'Cannot send {broadcast_event.id}. Previous event {prev_event.id} ' +
|
||||
f'(type {prev_event.message_type}) has no provider_message for provider {provider} yet.\n' +
|
||||
f'You must ensure that the other event sends succesfully, then manually kick off this event ' +
|
||||
f'again by re-running send_broadcast_provider_message for this event and provider.'
|
||||
'You must ensure that the other event sends succesfully, then manually kick off this event ' +
|
||||
'again by re-running send_broadcast_provider_message for this event and provider.'
|
||||
)
|
||||
|
||||
# if there's a previous message that has started but not finished sending (whether it fatally errored or is
|
||||
@@ -93,8 +92,8 @@ def check_provider_message_should_send(broadcast_event, provider):
|
||||
f'Cannot send {broadcast_event.id}. Previous event {prev_event.id} ' +
|
||||
f'(type {prev_event.message_type}) has not finished sending to provider {provider} yet.\n' +
|
||||
f'It is currently in status "{prev_provider_message.status}".\n' +
|
||||
f'You must ensure that the other event sends succesfully, then manually kick off this event ' +
|
||||
f'again by re-running send_broadcast_provider_message for this event and provider.'
|
||||
'You must ensure that the other event sends succesfully, then manually kick off this event ' +
|
||||
'again by re-running send_broadcast_provider_message for this event and provider.'
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -224,7 +224,8 @@ def check_if_letters_still_in_created():
|
||||
|
||||
msg = "{} letters were created before 17.30 yesterday and still have 'created' status. " \
|
||||
"Follow runbook to resolve: " \
|
||||
"https://github.com/alphagov/notifications-manuals/wiki/Support-Runbook#deal-with-Letters-still-in-created. " \
|
||||
"https://github.com/alphagov/notifications-manuals/wiki/Support-Runbook" \
|
||||
"#deal-with-Letters-still-in-created. " \
|
||||
"Notifications: {}".format(len(letters), letter_ids)
|
||||
|
||||
current_app.logger.warning(msg)
|
||||
|
||||
@@ -134,7 +134,7 @@ class CBCProxyClientBase(ABC):
|
||||
InvocationType='RequestResponse',
|
||||
Payload=payload_bytes,
|
||||
)
|
||||
except botocore.exceptions.ClientError as exc:
|
||||
except botocore.exceptions.ClientError:
|
||||
current_app.logger.exception(f'Boto ClientError calling lambda {lambda_name}')
|
||||
success = False
|
||||
return success
|
||||
|
||||
@@ -2,7 +2,6 @@ import boto3
|
||||
import botocore
|
||||
from flask import current_app
|
||||
from time import monotonic
|
||||
from notifications_utils.recipients import InvalidEmailError
|
||||
|
||||
from app.clients import STATISTICS_DELIVERED, STATISTICS_FAILURE
|
||||
from app.clients.email import EmailClient, EmailClientException, EmailClientNonRetryableException
|
||||
|
||||
@@ -151,7 +151,7 @@ def get_dt_string_or_none(val):
|
||||
|
||||
|
||||
def get_uuid_string_or_none(val):
|
||||
return str(val) if val else None
|
||||
return str(val) if val else None
|
||||
|
||||
|
||||
def format_sequential_number(sequential_number):
|
||||
|
||||
@@ -31,7 +31,7 @@ def create_broadcast():
|
||||
|
||||
if not validate_xml(cap_xml, 'CAP-v1.2.xsd'):
|
||||
raise BadRequestError(
|
||||
message=f'Request data is not valid CAP XML',
|
||||
message='Request data is not valid CAP XML',
|
||||
status_code=400,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user