From 13caa780870888116ba2e374ad1113fdbfe014af Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Mon, 9 Feb 2026 10:03:20 +0330 Subject: [PATCH] fix --> bug of download uploadded file --- apps/tag/web/api/v1/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tag/web/api/v1/api.py b/apps/tag/web/api/v1/api.py index 26fc151..aa0b586 100644 --- a/apps/tag/web/api/v1/api.py +++ b/apps/tag/web/api/v1/api.py @@ -1,3 +1,4 @@ +import random import typing from django.db import transaction @@ -761,7 +762,7 @@ class TagDistributionBatchViewSet( document = request.FILES.get('dist_exit_document') document_url = upload_to_storage( document, - f'distribution_batch_document.{str(document).split(".")[1]}' + f'{random.randint(1000, 9999)}_distribution_batch_document.{str(document).split(".")[1]}' ) dist_batch.warehouse_exit_doc = document_url dist_batch.save(update_fields=['warehouse_exit_doc'])