Remove the list from S3 once we don’t need it

Once a contact list is gone from the database there’s no way to
reference it again. Any jobs have made their own copy.

So we can clean it up, meaning we’re not storing personal data longer
than we need to.
This commit is contained in:
Chris Hill-Scott
2020-03-25 16:36:27 +00:00
parent b50dbab8fd
commit 4a6143aeb1
4 changed files with 38 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from app import DATE_FORMAT, DATETIME_FORMAT_NO_TIMEZONE
from app.aws import s3
from app.config import QueueNames
from app.dao import fact_notification_status_dao, notifications_dao
from app.dao.dao_utils import dao_rollback
@@ -1047,6 +1048,7 @@ def delete_contact_list_by_id(service_id, contact_list_id):
)
dao_unlink_jobs_from_contact_list_id(contact_list.id)
dao_delete_contact_list(contact_list)
s3.remove_contact_list_from_s3(service_id, contact_list_id)
return '', 204