save no expiration link

This commit is contained in:
Kseninia Mikhaylova 2024-08-09 09:30:27 +03:00
parent 3473547171
commit d9a55e2364
1 changed files with 2 additions and 1 deletions

View File

@ -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()