Archive, don’t delete contact lists

So we keep a record of who first uploaded a list it’s better to archive
a list than completely delete it.

The list in the database doesn’t contain any recipient info so this
isn’t a change to what data we’re retaining.

This means updating the endpoints that get contact lists to exclude ones
that are archived.
This commit is contained in:
Chris Hill-Scott
2020-03-26 11:38:04 +00:00
parent 4a6143aeb1
commit 5fe0fafadf
9 changed files with 77 additions and 25 deletions

View File

@@ -238,12 +238,21 @@ def test_create_scheduled_job(client, sample_template, mocker, fake_uuid):
assert resp_json['data']['notification_count'] == 1
def test_create_job_with_contact_list_id(client, mocker, sample_template, fake_uuid):
@pytest.mark.parametrize('contact_list_archived', (
True, False,
))
def test_create_job_with_contact_list_id(
client,
mocker,
sample_template,
fake_uuid,
contact_list_archived,
):
mocker.patch('app.celery.tasks.process_job.apply_async')
mocker.patch('app.job.rest.get_job_metadata_from_s3', return_value={
'template_id': str(sample_template.id)
})
contact_list = create_service_contact_list()
contact_list = create_service_contact_list(archived=contact_list_archived)
data = {
'id': fake_uuid,
'valid': 'True',