From 3effb75045b84e940c70b4e0fbfe353fe87263c6 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Wed, 23 Feb 2022 17:25:35 +0000 Subject: [PATCH] Clarify purpose of file_id in redirects In response to: [1]. [1]: https://github.com/alphagov/notifications-admin/pull/4159/files#r813050941 --- app/main/views/uploads.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/main/views/uploads.py b/app/main/views/uploads.py index 0a7a1c0f4..fbaf77240 100644 --- a/app/main/views/uploads.py +++ b/app/main/views/uploads.py @@ -270,8 +270,10 @@ def uploaded_letter_preview(service_id, file_id): except LetterNotFoundError as e: current_app.logger.warning(e) - # if the file's not there, it's probably because we've already created the notification and the letter has been - # moved to the normal letters-pdf bucket. So lets just bounce out to the notification page + # If the file is missing it could be because this is a duplicate + # request, the notification already exists and the file has been + # moved to a different bucket. Note that the ID of a precompiled + # notification is always set to the file_id. return redirect(url_for( '.view_notification', service_id=service_id, @@ -356,8 +358,10 @@ def send_uploaded_letter(service_id, file_id): except LetterNotFoundError as e: current_app.logger.error(e) - # if the file's not there, it's probably because we've already created the notification and the letter has been - # moved to the normal letters-pdf bucket. So lets just bounce out to the notification page + # If the file is missing it could be because this is a duplicate + # request, the notification already exists and the file has been + # moved to a different bucket. Note that the ID of a precompiled + # notification is always set to the file_id. return redirect(url_for( '.view_notification', service_id=service_id,