diff --git a/src/palace/manager/celery/tasks/generate_inventory_and_hold_reports.py b/src/palace/manager/celery/tasks/generate_inventory_and_hold_reports.py index 8748cefb3..cd0c9de9f 100644 --- a/src/palace/manager/celery/tasks/generate_inventory_and_hold_reports.py +++ b/src/palace/manager/celery/tasks/generate_inventory_and_hold_reports.py @@ -28,6 +28,7 @@ ) from palace.manager.sqlalchemy.model.library import Library from palace.manager.sqlalchemy.util import get_one +from palace.manager.util.uuid import uuid_encode def eligible_integrations( @@ -148,7 +149,7 @@ def run(self) -> None: arcname=f"palace-inventory-report-for-library-{file_name_modifier}.csv", ) - uid = uuid.uuid4() + uid = uuid_encode(uuid.uuid4()) key = ( f"{S3Service.DOWNLOADS_PREFIX}/inventory_and_holds/{library.short_name}/" f"inventory-and-holds-for-library-{file_name_modifier}-{uid}.zip" diff --git a/src/palace/manager/scripts/playtime_entries.py b/src/palace/manager/scripts/playtime_entries.py index c22ec9565..a9bff8ee6 100644 --- a/src/palace/manager/scripts/playtime_entries.py +++ b/src/palace/manager/scripts/playtime_entries.py @@ -23,6 +23,7 @@ from palace.manager.service.storage.s3 import S3Service from palace.manager.sqlalchemy.model.time_tracking import PlaytimeEntry, PlaytimeSummary from palace.manager.util.datetime_helpers import previous_months, utc_now +from palace.manager.util.uuid import uuid_encode if TYPE_CHECKING: from sqlalchemy.orm import Query @@ -186,9 +187,10 @@ def do_run(self): email_subject = f"{subject_prefix}Playtime Summaries {formatted_start_date} - {formatted_until_date}" reporting_name_with_no_spaces = reporting_name.replace(" ", "_") + "-" link_extension = "csv" + uid = uuid_encode(uuid.uuid4()) linked_file_name = ( f"playtime-summary-{reporting_name_with_no_spaces}" - f"{formatted_start_date}-{formatted_until_date}.{link_extension}" + f"{formatted_start_date}-{formatted_until_date}-{uid}.{link_extension}" ) # Write to a temporary file so we don't overflow the memory @@ -210,7 +212,6 @@ def do_run(self): ) if recipient: - uid = uuid.uuid4() key = ( f"{S3Service.DOWNLOADS_PREFIX}/{reporting_name}/" f"{linked_file_name}"