Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 7b1d26a

Browse files
committed
fix: Conditionally generate external_id for uploads
1 parent c9ca88f commit 7b1d26a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

upload/views/uploads.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ def create_upload(
5858
)
5959
archive_service = ArchiveService(repository)
6060
# only Shelter requests are allowed to set their own `storage_path`
61-
serializer.validated_data["external_id"] = uuid.uuid4()
61+
6262
if serializer.validated_data["storage_path"] is None or not is_shelter_request:
63+
serializer.validated_data["external_id"] = uuid.uuid4()
6364
path = MinioEndpoints.raw_with_upload_id.get_path(
6465
version="v4",
6566
date=timezone.now().strftime("%Y-%m-%d"),

0 commit comments

Comments
 (0)