merge from main

This commit is contained in:
Kenneth Kehl
2023-05-10 09:58:03 -07:00
11 changed files with 240 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ def _update_notification_status(notification, status, provider_response=None):
@autocommit
def update_notification_status_by_id(notification_id, status, sent_by=None):
def update_notification_status_by_id(notification_id, status, sent_by=None, provider_response=None):
notification = Notification.query.with_for_update().filter(Notification.id == notification_id).first()
if not notification:
@@ -121,6 +121,8 @@ def update_notification_status_by_id(notification_id, status, sent_by=None):
and not country_records_delivery(notification.phone_prefix)
):
return None
if provider_response:
notification.provider_response = provider_response
if not notification.sent_by and sent_by:
notification.sent_by = sent_by
return _update_notification_status(