mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Update save_letter to handle research mode
This commit is contained in:
@@ -317,13 +317,17 @@ def save_letter(
|
||||
reply_to_text=service.get_default_letter_contact()
|
||||
)
|
||||
|
||||
if (
|
||||
service.has_permission('letters_as_pdf') and not service.research_mode
|
||||
):
|
||||
letters_pdf_tasks.create_letters_pdf.apply_async(
|
||||
[str(saved_notification.id)],
|
||||
queue=QueueNames.CREATE_LETTERS_PDF
|
||||
)
|
||||
if service.has_permission('letters_as_pdf'):
|
||||
if not service.research_mode:
|
||||
letters_pdf_tasks.create_letters_pdf.apply_async(
|
||||
[str(saved_notification.id)],
|
||||
queue=QueueNames.CREATE_LETTERS_PDF
|
||||
)
|
||||
else:
|
||||
update_letter_notifications_to_sent_to_dvla.apply_async(
|
||||
kwargs={'notification_references': [saved_notification.reference]},
|
||||
queue=QueueNames.RESEARCH_MODE
|
||||
)
|
||||
|
||||
current_app.logger.info("Letter {} created at {}".format(saved_notification.id, saved_notification.created_at))
|
||||
except SQLAlchemyError as e:
|
||||
|
||||
Reference in New Issue
Block a user