From d9a55e23649afbd2c849cf16d1df3a7699c84504 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Fri, 9 Aug 2024 09:30:27 +0300 Subject: [PATCH] save no expiration link --- back/tgbot/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/back/tgbot/tasks.py b/back/tgbot/tasks.py index 2d3d116..4e6e330 100644 --- a/back/tgbot/tasks.py +++ b/back/tgbot/tasks.py @@ -33,6 +33,7 @@ def upload_file(file_id): aws_secret_access_key=settings.SELECTEL['secret'], ) s3.upload_fileobj(r.raw, 'inventorization', file_id) - obj.image_aws_url = file_id + object_url = s3.generate_presigned_url('get_object', ExpiresIn=0, Params={'Bucket': 'inventorization', 'Key': file_id}) + obj.image_aws_url = object_url obj.save()