fix personalization on job/service/notification api

This commit is contained in:
Kenneth Kehl
2024-04-05 11:38:00 -07:00
parent 41ace5bfad
commit 23335bb4a9
2 changed files with 14 additions and 9 deletions

View File

@@ -90,6 +90,14 @@ def get_all_notifications_for_service_job(service_id, job_id):
notification.to = recipient
notification.normalised_to = recipient
for notification in paginated_notifications.items:
if notification.job_id is not None:
notification.personalisation = get_personalisation_from_s3(
notification.service_id,
notification.job_id,
notification.job_row_number,
)
notifications = None
if data.get("format_for_csv"):
notifications = [
@@ -101,14 +109,6 @@ def get_all_notifications_for_service_job(service_id, job_id):
paginated_notifications.items, many=True
)
for notification in paginated_notifications.items:
if notification.job_id is not None:
notification.personalisation = get_personalisation_from_s3(
notification.service_id,
notification.job_id,
notification.job_row_number,
)
return (
jsonify(
notifications=notifications,