mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Merge pull request #1646 from alphagov/add-tags-to-pdf-letters
upload letter pdfs with retention tag
This commit is contained in:
@@ -14,6 +14,7 @@ from notifications_utils.s3 import s3upload
|
||||
from app import notify_celery
|
||||
from app.aws import s3
|
||||
from app.config import QueueNames, TaskNames
|
||||
from app.variables import Retention
|
||||
from app.dao.notifications_dao import (
|
||||
get_notification_by_id,
|
||||
update_notification_status_by_id,
|
||||
@@ -68,7 +69,8 @@ def create_letters_pdf(self, notification_id):
|
||||
filedata=pdf_data,
|
||||
region=current_app.config['AWS_REGION'],
|
||||
bucket_name=current_app.config['LETTERS_PDF_BUCKET_NAME'],
|
||||
file_location=upload_file_name
|
||||
file_location=upload_file_name,
|
||||
tags={Retention.KEY: Retention.ONE_WEEK}
|
||||
)
|
||||
|
||||
current_app.logger.info("Uploaded letters PDF {} to {}".format(
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# all jobs for letters created via the api must have this filename
|
||||
LETTER_API_FILENAME = 'letter submitted via api'
|
||||
LETTER_TEST_API_FILENAME = 'test letter submitted via api'
|
||||
|
||||
|
||||
# S3 tags
|
||||
class Retention:
|
||||
KEY = 'retention'
|
||||
|
||||
ONE_WEEK = 'ONE_WEEK'
|
||||
|
||||
Reference in New Issue
Block a user