From 023862dfdcdae803c7982b66a78fd9c10904b689 Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Tue, 27 Mar 2018 13:32:46 +0100 Subject: [PATCH] Refactored code to be more Pythonic and make the code more readable --- app/letters/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/letters/utils.py b/app/letters/utils.py index 37d1145a2..4fa041491 100644 --- a/app/letters/utils.py +++ b/app/letters/utils.py @@ -104,10 +104,7 @@ def move_scanned_pdf_to_test_or_live_pdf_bucket(source_filename, is_test_letter= def move_failed_pdf(source_filename, scan_error_type): scan_bucket = current_app.config['LETTERS_SCAN_BUCKET_NAME'] - if scan_error_type == ScanErrorType.ERROR: - target_filename = 'ERROR/' + source_filename - elif scan_error_type == ScanErrorType.FAILURE: - target_filename = 'FAILURE/' + source_filename + target_filename = ('ERROR/' if scan_error_type == ScanErrorType.ERROR else 'FAILURE/') + source_filename _move_s3_object(scan_bucket, source_filename, scan_bucket, target_filename)