set letter notifications to pending while notify-ftp does its stuff

this means that if the task is accidentally ran twice (eg we autoscale
notify-celery-worker-beat to 2), it won't send letters twice.

Additionally, update some function names and config variables to make
it clear that they are referring to letter jobs, rather than all letter
content
This commit is contained in:
Leo Hemsted
2017-09-15 17:46:08 +01:00
parent f61ccd8ff0
commit 7dd3c1df5a
7 changed files with 81 additions and 21 deletions

View File

@@ -1058,7 +1058,7 @@ def test_build_dvla_file(sample_letter_template, mocker):
mocked_upload.assert_called_once_with(
filedata="dvla|string\ndvla|string\n",
region=current_app.config['AWS_REGION'],
bucket_name=current_app.config['DVLA_UPLOAD_BUCKET_NAME'],
bucket_name=current_app.config['DVLA_BUCKETS']['job'],
file_location="{}-dvla-job.text".format(job.id)
)
assert Job.query.get(job.id).job_status == 'ready to send'