remove jobs from letter api and make success/error ftp callback tasks

1. No longer create jobs when creating letters from api 🎉
2. Bulk update notifications based on the notification references after
   we send them to DVLA - either as success or as error
This commit is contained in:
Leo Hemsted
2017-09-20 11:12:37 +01:00
parent 7dd3c1df5a
commit 17ba8db97f
5 changed files with 59 additions and 27 deletions

View File

@@ -153,8 +153,7 @@ def process_letter_notification(*, letter_data, api_key, template):
if api_key.service.restricted and api_key.key_type != KEY_TYPE_TEST:
raise BadRequestError(message='Cannot send letters when service is in trial mode', status_code=403)
job = create_letter_api_job(template)
notification = create_letter_notification(letter_data, job, api_key)
notification = create_letter_notification(letter_data, template, api_key)
if api_key.service.research_mode or api_key.key_type == KEY_TYPE_TEST:
# distinguish real API jobs from test jobs by giving the test jobs a different filename