mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
Allow international letters to be cancelled
Our code was assuming that any notifications with `international` set to `True` were text messages. It was then trying to look up delivery information for a notification which wasn’t sent to a phone number, causing an exception.
This commit is contained in:
@@ -140,7 +140,11 @@ def update_notification_status_by_id(notification_id, status, sent_by=None, deta
|
||||
_duplicate_update_warning(notification, status)
|
||||
return None
|
||||
|
||||
if notification.international and not country_records_delivery(notification.phone_prefix):
|
||||
if (
|
||||
notification.notification_type == 'sms'
|
||||
and notification.international
|
||||
and not country_records_delivery(notification.phone_prefix)
|
||||
):
|
||||
return None
|
||||
if not notification.sent_by and sent_by:
|
||||
notification.sent_by = sent_by
|
||||
|
||||
Reference in New Issue
Block a user