Upload precompiled letter pdfs to letters-scan bucket

This commit is contained in:
Ken Tsang
2018-03-13 14:08:34 +00:00
parent 30e371fa4c
commit 8733d84e75
3 changed files with 43 additions and 1 deletions

View File

@@ -451,7 +451,7 @@ class Sandbox(CloudFoundryConfig):
TEST_LETTERS_BUCKET_NAME = 'cf-sandbox-test-letters'
DVLA_RESPONSE_BUCKET_NAME = 'notify.works-ftp'
LETTERS_PDF_BUCKET_NAME = 'cf-sandbox-letters-pdf'
LETTERS_SCAN_BUCKET_NAME = 'cf-sandbox-virus-check-pdf'
LETTERS_SCAN_BUCKET_NAME = 'cf-sandbox-letters-scan'
FROM_NUMBER = 'sandbox'
REDIS_ENABLED = False

View File

@@ -64,6 +64,11 @@ def upload_letter_pdf(notification, pdf_data, is_test_letter=False):
else:
bucket_name = current_app.config['LETTERS_PDF_BUCKET_NAME']
if notification.template.is_precompiled_letter:
bucket_name = current_app.config['LETTERS_SCAN_BUCKET_NAME']
else:
bucket_name = current_app.config['LETTERS_PDF_BUCKET_NAME']
s3upload(
filedata=pdf_data,
region=current_app.config['AWS_REGION'],