diff --git a/app/celery/service_callback_tasks.py b/app/celery/service_callback_tasks.py index bf436b883..258ba9f9b 100644 --- a/app/celery/service_callback_tasks.py +++ b/app/celery/service_callback_tasks.py @@ -23,7 +23,7 @@ def send_delivery_status_to_service( status_update = encryption.decrypt(encrypted_status_update) data = { - "notification_id": str(notification_id), + "id": str(notification_id), "reference": status_update['notification_client_reference'], "to": status_update['notification_to'], "status": status_update['notification_status'], @@ -64,7 +64,7 @@ def send_complaint_to_service(self, complaint_data): def _send_data_to_service_callback_api(self, data, service_callback_url, token, function_name): - notification_id = data["notification_id"] + notification_id = (data["notification_id"] if "notification_id" in data else data["id"]) try: response = request( method="POST", diff --git a/tests/app/celery/test_service_callback_tasks.py b/tests/app/celery/test_service_callback_tasks.py index 543c90cf2..b17451722 100644 --- a/tests/app/celery/test_service_callback_tasks.py +++ b/tests/app/celery/test_service_callback_tasks.py @@ -38,7 +38,7 @@ def test_send_delivery_status_to_service_post_https_request_to_service_with_encr send_delivery_status_to_service(notification.id, encrypted_status_update=encrypted_status_update) mock_data = { - "notification_id": str(notification.id), + "id": str(notification.id), "reference": notification.client_reference, "to": notification.to, "status": notification.status,