notify-api-317 fix the scrubbing of pii for successful notifications

This commit is contained in:
Kenneth Kehl
2023-06-27 10:48:14 -07:00
parent 12f3a7ee5d
commit 17e9fc1e8f
4 changed files with 31 additions and 10 deletions

View File

@@ -272,7 +272,7 @@ def _filter_query(query, filter_dict=None):
@autocommit
def sanitize_notifications_by_id(
def sanitize_successful_notification_by_id(
notification_id
):
# TODO what to do for international?
@@ -280,12 +280,10 @@ def sanitize_notifications_by_id(
Notification.query.filter(
Notification.id.in_([notification_id]),
).update(
{'to': phone_prefix, 'normalised_to': phone_prefix},
{'to': phone_prefix, 'normalised_to': phone_prefix, 'status': 'delivered'},
synchronize_session=False
)
db.session.commit()
@autocommit
def insert_notification_history_delete_notifications(