mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Add a new task to update a job to error - note it leaves the notifications in whatever state they were in.
This commit is contained in:
@@ -36,7 +36,7 @@ from app.models import (
|
||||
JOB_STATUS_IN_PROGRESS,
|
||||
JOB_STATUS_FINISHED,
|
||||
JOB_STATUS_READY_TO_SEND,
|
||||
JOB_STATUS_SENT_TO_DVLA)
|
||||
JOB_STATUS_SENT_TO_DVLA, JOB_STATUS_ERROR)
|
||||
from app.notifications.process_notifications import persist_notification
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.statsd_decorators import statsd
|
||||
@@ -306,6 +306,13 @@ def update_job_to_sent_to_dvla(self, job_id):
|
||||
"Updated {} job to {}".format(updated_count, job_id, JOB_STATUS_SENT_TO_DVLA))
|
||||
|
||||
|
||||
@notify_celery.task(bind=True, name='update-letter-job-to-error')
|
||||
@statsd(namespace="tasks")
|
||||
def update_dvla_job_to_error(self, job_id):
|
||||
dao_update_job_status(job_id, JOB_STATUS_ERROR)
|
||||
current_app.logger.info("Updated {} job to {}".format(job_id, JOB_STATUS_ERROR))
|
||||
|
||||
|
||||
def create_dvla_file_contents(job_id):
|
||||
file_contents = '\n'.join(
|
||||
str(LetterDVLATemplate(
|
||||
|
||||
Reference in New Issue
Block a user