Use sanitised pdfs for sending and handle invalid pdfs, details below:

- pass new, sanitised pdf for sending
- move invalid pdfs to a newly created bucket
- set status fro notifications that failed pdf validation to a new status validation-failed
- adjust existing tests
This commit is contained in:
Pea Tyczynska
2018-09-03 13:24:51 +01:00
committed by Leo Hemsted
parent cd563283d5
commit e22e7245fe
8 changed files with 61 additions and 15 deletions

View File

@@ -107,6 +107,12 @@ def move_error_pdf_to_scan_bucket(source_filename):
_move_s3_object(scan_bucket, error_file, scan_bucket, source_filename)
def move_scan_to_invalid_pdf_bucket(source_filename):
invalid_pdf_bucket = current_app.config['INVALID_PDF_BUCKET_NAME']
invalid_pdf = source_filename
_move_s3_object(invalid_pdf_bucket, invalid_pdf, invalid_pdf_bucket, source_filename)
def get_file_names_from_error_bucket():
s3 = boto3.resource('s3')
scan_bucket = current_app.config['LETTERS_SCAN_BUCKET_NAME']