Get and use sender_id from S3 metadata

The `save_email` and `save_sms` jobs were updated previously to take an
optional `sender_id` and to use this if it was available. This commit
now gets the `sender_id` from the S3 metadata if it exists and passes it
through the the tasks which save the job notifications. This means SMS
and emails sent through jobs can use a specified `sender_id` instead of
the default.
This commit is contained in:
Katie Smith
2018-11-05 16:16:48 +00:00
parent 8b5d48b113
commit d20e35d075
4 changed files with 117 additions and 3 deletions

View File

@@ -150,8 +150,10 @@ def create_job(service_id):
dao_create_job(job)
sender_id = data.get('sender_id')
if job.job_status == JOB_STATUS_PENDING:
process_job.apply_async([str(job.id)], queue=QueueNames.JOBS)
process_job.apply_async([str(job.id)], {'sender_id': sender_id}, queue=QueueNames.JOBS)
job_json = job_schema.dump(job).data
job_json['statistics'] = []