mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Change get_bucket_name_and_prefix_for_notification to use created_at
The `get_bucket_name_and_prefix_for_notification` function was looking at the `sent_at` or `updated_at` at time of a notification to see which bucket it was in. Precompiled letters sent through the admin app don't have either of these times - they only have a `created_at` time, so this lets the function check `created_at` time too.
This commit is contained in:
@@ -63,8 +63,10 @@ def get_bucket_name_and_prefix_for_notification(notification):
|
||||
bucket_name = current_app.config['LETTERS_PDF_BUCKET_NAME']
|
||||
if notification.sent_at:
|
||||
folder = "{}/".format(notification.sent_at.date())
|
||||
else:
|
||||
elif notification.updated_at:
|
||||
folder = get_folder_name(notification.updated_at, False)
|
||||
else:
|
||||
folder = get_folder_name(notification.created_at, False)
|
||||
|
||||
upload_file_name = PRECOMPILED_BUCKET_PREFIX.format(
|
||||
folder=folder,
|
||||
|
||||
Reference in New Issue
Block a user