mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 15:52:21 -05:00
revamp PII masking
This commit is contained in:
@@ -19,12 +19,12 @@ from app.dao.service_inbound_api_dao import get_service_inbound_api_for_service
|
||||
from app.dao.service_sms_sender_dao import dao_get_service_sms_senders_by_id
|
||||
from app.dao.templates_dao import dao_get_template_by_id
|
||||
from app.enums import JobStatus, KeyType, NotificationType
|
||||
from app.errors import TotalRequestsError
|
||||
from app.notifications.process_notifications import persist_notification
|
||||
from app.notifications.validators import check_service_over_total_message_limit
|
||||
from app.serialised_models import SerialisedService, SerialisedTemplate
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.utils import DATETIME_FORMAT, hilite, utc_now
|
||||
from app.v2.errors import TotalRequestsError
|
||||
from notifications_utils.recipients import RecipientCSV
|
||||
|
||||
|
||||
@@ -190,7 +190,9 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i
|
||||
# to non-team and non-simulated recipients.
|
||||
if not service_allowed_to_send_to(notification["to"], service, KeyType.NORMAL):
|
||||
current_app.logger.info(
|
||||
hilite(f"service not allowed to send to {notification['to']}, aborting")
|
||||
hilite(
|
||||
f"service not allowed to send for job_id {notification.get('job', None)}, aborting"
|
||||
)
|
||||
)
|
||||
current_app.logger.debug(
|
||||
"SMS {} failed as restricted service".format(notification_id)
|
||||
@@ -222,8 +224,11 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i
|
||||
)
|
||||
|
||||
# Kick off sns process in provider_tasks.py
|
||||
sn = saved_notification
|
||||
current_app.logger.info(
|
||||
hilite(f"Going to deliver sms for recipient: {notification['to']}")
|
||||
hilite(
|
||||
f"Deliver sms for job_id: {sn.job_id} row_number: {sn.job_row_number}"
|
||||
)
|
||||
)
|
||||
provider_tasks.deliver_sms.apply_async(
|
||||
[str(saved_notification.id)], queue=QueueNames.SEND_SMS
|
||||
|
||||
Reference in New Issue
Block a user