diff --git a/app/commands.py b/app/commands.py index 341d657f6..ad7e8ad2f 100644 --- a/app/commands.py +++ b/app/commands.py @@ -19,7 +19,10 @@ from sqlalchemy.orm.exc import NoResultFound from app import db 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 ( 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) +@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') @click.option('-f', '--file_name', required=True, help="""Full path of the file to upload, file is a contains client references of