mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
merge from main and fix some tests
This commit is contained in:
@@ -2,7 +2,11 @@ import dateutil
|
||||
import pytz
|
||||
from flask import Blueprint, current_app, jsonify, request
|
||||
|
||||
from app.aws.s3 import get_job_metadata_from_s3, get_personalisation_from_s3
|
||||
from app.aws.s3 import (
|
||||
get_job_metadata_from_s3,
|
||||
get_personalisation_from_s3,
|
||||
get_phone_number_from_s3,
|
||||
)
|
||||
from app.celery.tasks import process_job
|
||||
from app.config import QueueNames
|
||||
from app.dao.fact_notification_status_dao import fetch_notification_statuses_for_job
|
||||
@@ -76,6 +80,16 @@ def get_all_notifications_for_service_job(service_id, job_id):
|
||||
kwargs["service_id"] = service_id
|
||||
kwargs["job_id"] = job_id
|
||||
|
||||
for notification in paginated_notifications.items:
|
||||
if notification.job_id is not None:
|
||||
recipient = get_phone_number_from_s3(
|
||||
notification.service_id,
|
||||
notification.job_id,
|
||||
notification.job_row_number,
|
||||
)
|
||||
notification.to = recipient
|
||||
notification.normalised_to = recipient
|
||||
|
||||
notifications = None
|
||||
if data.get("format_for_csv"):
|
||||
notifications = [
|
||||
@@ -90,8 +104,10 @@ def get_all_notifications_for_service_job(service_id, job_id):
|
||||
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
|
||||
)
|
||||
notification.service_id,
|
||||
notification.job_id,
|
||||
notification.job_row_number,
|
||||
)
|
||||
|
||||
return (
|
||||
jsonify(
|
||||
|
||||
Reference in New Issue
Block a user