mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
debug for notify-admin-1588
This commit is contained in:
@@ -13,7 +13,7 @@ from app.dao.provider_details_dao import get_provider_details_by_notification_ty
|
||||
from app.enums import BrandType, KeyType, NotificationStatus, NotificationType
|
||||
from app.exceptions import NotificationTechnicalFailureException
|
||||
from app.serialised_models import SerialisedService, SerialisedTemplate
|
||||
from app.utils import utc_now
|
||||
from app.utils import hilite, scrub, utc_now
|
||||
from notifications_utils.template import (
|
||||
HTMLEmailTemplate,
|
||||
PlainTextEmailTemplate,
|
||||
@@ -109,15 +109,19 @@ def send_sms_to_provider(notification):
|
||||
"international": notification.international,
|
||||
}
|
||||
db.session.close() # no commit needed as no changes to objects have been made above
|
||||
current_app.logger.info("sending to sms")
|
||||
|
||||
message_id = provider.send_sms(**send_sms_kwargs)
|
||||
current_app.logger.info(f"got message_id {message_id}")
|
||||
except Exception as e:
|
||||
current_app.logger.error(e)
|
||||
msg = f"FAILED sending message for this recipient: {recipient} to sms"
|
||||
current_app.logger.error(hilite(scrub(f"{msg} {e}")))
|
||||
|
||||
notification.billable_units = template.fragment_count
|
||||
dao_update_notification(notification)
|
||||
raise e
|
||||
else:
|
||||
msg = f"Sending message for this recipient: {recipient} to sms"
|
||||
current_app.logger.info(hilite(scrub(msg)))
|
||||
notification.billable_units = template.fragment_count
|
||||
update_notification_to_sending(notification, provider)
|
||||
return message_id
|
||||
|
||||
Reference in New Issue
Block a user