mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Call the create letters pdf task in api calls for services with letters as pdf
This commit is contained in:
@@ -14,6 +14,7 @@ from app.models import (
|
||||
NOTIFICATION_CREATED,
|
||||
NOTIFICATION_SENDING
|
||||
)
|
||||
from app.celery.letters_pdf_tasks import create_letters_pdf
|
||||
from app.celery.tasks import update_letter_notifications_to_sent_to_dvla
|
||||
from app.notifications.process_notifications import (
|
||||
persist_notification,
|
||||
@@ -187,6 +188,12 @@ def process_letter_notification(*, letter_data, api_key, template):
|
||||
queue=QueueNames.RESEARCH_MODE
|
||||
)
|
||||
|
||||
if api_key.service.has_permission('letters_as_pdf'):
|
||||
create_letters_pdf.apply_async(
|
||||
[str(notification.id)],
|
||||
queue=QueueNames.CREATE_LETTERS_PDF
|
||||
)
|
||||
|
||||
return notification
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user