From 2a6258679923594fb77b625ce49240e9308770a9 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 27 May 2022 15:33:48 +0100 Subject: [PATCH] Reflect change in argument name `filename_or_fp` was changed to `path_or_file` here: https://github.com/pallets/flask/pull/3828/files#diff-1f51c8ded4d4ff7e13badab599ef22436c529c2b5f9c25dc6250c1f9fd985440R479 --- app/main/views/notifications.py | 2 +- app/main/views/uploads.py | 2 +- app/s3_client/s3_mou_client.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index 7235a4b0b..fdde0f6bd 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -230,7 +230,7 @@ def view_letter_notification_as_preview( mimetype = 'image/png' if filetype == 'png' else 'application/pdf' return send_file( - filename_or_fp=file, + path_or_file=file, mimetype=mimetype, ) diff --git a/app/main/views/uploads.py b/app/main/views/uploads.py index a3d43d7e2..d688e457f 100644 --- a/app/main/views/uploads.py +++ b/app/main/views/uploads.py @@ -584,7 +584,7 @@ def delete_contact_list(service_id, contact_list_id): def download_contact_list(service_id, contact_list_id): contact_list = ContactList.from_id(contact_list_id, service_id=service_id) return send_file( - filename_or_fp=BytesIO(contact_list.contents.encode('utf-8')), + path_or_file=BytesIO(contact_list.contents.encode('utf-8')), attachment_filename=contact_list.saved_file_name, as_attachment=True, ) diff --git a/app/s3_client/s3_mou_client.py b/app/s3_client/s3_mou_client.py index d86e7b2cc..b6921df66 100644 --- a/app/s3_client/s3_mou_client.py +++ b/app/s3_client/s3_mou_client.py @@ -13,7 +13,7 @@ def get_mou(organisation_is_crown): try: key = get_s3_object(bucket, filename) return { - 'filename_or_fp': key.get()['Body'], + 'path_or_file': key.get()['Body'], 'attachment_filename': attachment_filename, 'as_attachment': True, }