mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
@@ -87,9 +87,7 @@ def persist_notification(
|
||||
if not notification_id:
|
||||
notification_id = uuid.uuid4()
|
||||
|
||||
current_app.logger.info(
|
||||
"Persisting notification with id {}".format(notification_id)
|
||||
)
|
||||
current_app.logger.info(f"Persisting notification with id {notification_id}")
|
||||
|
||||
notification = Notification(
|
||||
id=notification_id,
|
||||
@@ -124,9 +122,7 @@ def persist_notification(
|
||||
notification.phone_prefix = recipient_info.country_prefix
|
||||
notification.rate_multiplier = recipient_info.billable_units
|
||||
elif notification_type == EMAIL_TYPE:
|
||||
current_app.logger.info(
|
||||
"Persisting notification with type: {}".format(EMAIL_TYPE)
|
||||
)
|
||||
current_app.logger.info(f"Persisting notification with type: {EMAIL_TYPE}")
|
||||
notification.normalised_to = format_email_address(notification.to)
|
||||
|
||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||
@@ -141,9 +137,7 @@ def persist_notification(
|
||||
)
|
||||
|
||||
current_app.logger.info(
|
||||
"{} {} created at {}".format(
|
||||
notification_type, notification_id, notification_created_at
|
||||
)
|
||||
f"{notification_type} {notification_id} created at {notification_created_at}"
|
||||
)
|
||||
return notification
|
||||
|
||||
@@ -170,15 +164,13 @@ def send_notification_to_queue_detached(
|
||||
raise
|
||||
|
||||
current_app.logger.debug(
|
||||
"{} {} sent to the {} queue for delivery".format(
|
||||
notification_type, notification_id, queue
|
||||
)
|
||||
f"{notification_type} {notification_id} sent to the {queue} queue for delivery"
|
||||
)
|
||||
|
||||
|
||||
def send_notification_to_queue(notification, queue=None):
|
||||
send_notification_to_queue_detached(
|
||||
notification.key_type, notification.notification_type, notification.id, queue
|
||||
notification.key_type, notification.notification_type, notification.id, queue,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user