Add function to send PDF letter

This function checks various permissions, downloads the PDF from the
transient bucket, creates the notification then moves the letter to the
'normal' bucket.
This commit is contained in:
Katie Smith
2019-09-05 17:36:02 +01:00
parent 081543a2a9
commit eb73ddb8b4
3 changed files with 178 additions and 1 deletions

View File

@@ -137,6 +137,15 @@ def move_scan_to_invalid_pdf_bucket(source_filename):
_move_s3_object(scan_bucket, source_filename, invalid_pdf_bucket, source_filename)
def move_uploaded_pdf_to_letters_bucket(source_filename, upload_filename):
_move_s3_object(
source_bucket=current_app.config['TRANSIENT_UPLOADED_LETTERS'],
source_filename=source_filename,
target_bucket=current_app.config['LETTERS_PDF_BUCKET_NAME'],
target_filename=upload_filename
)
def get_file_names_from_error_bucket():
s3 = boto3.resource('s3')
scan_bucket = current_app.config['LETTERS_SCAN_BUCKET_NAME']