mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Add command to run recreate_pdf_for_precompiled_or_uploaded_letter
We already had the `replay-create-pdf-for-templated-letter` command. This adds a new command, `recreate-pdf-for-precompiled-or-uploaded-letter` which does the same thing but for non-templated letters.
This commit is contained in:
@@ -19,7 +19,10 @@ from sqlalchemy.orm.exc import NoResultFound
|
|||||||
|
|
||||||
from app import db
|
from app import db
|
||||||
from app.aws import s3
|
from app.aws import s3
|
||||||
from app.celery.letters_pdf_tasks import get_pdf_for_templated_letter
|
from app.celery.letters_pdf_tasks import (
|
||||||
|
get_pdf_for_templated_letter,
|
||||||
|
resanitise_pdf,
|
||||||
|
)
|
||||||
from app.celery.reporting_tasks import (
|
from app.celery.reporting_tasks import (
|
||||||
create_nightly_notification_status_for_day,
|
create_nightly_notification_status_for_day,
|
||||||
)
|
)
|
||||||
@@ -279,6 +282,14 @@ def replay_create_pdf_for_templated_letter(notification_id):
|
|||||||
get_pdf_for_templated_letter.apply_async([str(notification_id)], queue=QueueNames.CREATE_LETTERS_PDF)
|
get_pdf_for_templated_letter.apply_async([str(notification_id)], queue=QueueNames.CREATE_LETTERS_PDF)
|
||||||
|
|
||||||
|
|
||||||
|
@notify_command(name='recreate-pdf-for-precompiled-or-uploaded-letter')
|
||||||
|
@click.option('-n', '--notification_id', type=click.UUID, required=True,
|
||||||
|
help="Notification ID of the precompiled or uploaded letter")
|
||||||
|
def recreate_pdf_for_precompiled_or_uploaded_letter(notification_id):
|
||||||
|
print(f"Call resanitise_pdf task for notification: {notification_id}")
|
||||||
|
resanitise_pdf.apply_async([str(notification_id)], queue=QueueNames.LETTERS)
|
||||||
|
|
||||||
|
|
||||||
@notify_command(name='replay-service-callbacks')
|
@notify_command(name='replay-service-callbacks')
|
||||||
@click.option('-f', '--file_name', required=True,
|
@click.option('-f', '--file_name', required=True,
|
||||||
help="""Full path of the file to upload, file is a contains client references of
|
help="""Full path of the file to upload, file is a contains client references of
|
||||||
|
|||||||
Reference in New Issue
Block a user