Skip to content

Commit

Permalink
reformat line #81
Browse files Browse the repository at this point in the history
  • Loading branch information
asuresh-code committed Jan 14, 2025
1 parent b21b555 commit 7a81600
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions object_storage_api/stores/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ class ImageStore:
Store for managing images in an S3 object store.
"""

def upload(
self,
image_id: str,
image_metadata: ImagePostMetadataSchema,
upload_file: UploadFile,
) -> str:
def upload(self, image_id: str, image_metadata: ImagePostMetadataSchema, upload_file: UploadFile) -> str:
"""
Uploads a given image to object storage.
Expand Down Expand Up @@ -51,17 +46,13 @@ def create_presigned_get(self, image: ImageOut) -> str:
:param image: `ImageOut` model of the image.
:return: Presigned url to get the image.
"""
logger.info(
"Generating presigned url to get image with object key: %s from the object store",
image.object_key,
)
logger.info("Generating presigned url to get image with object key: %s from the object store", image.object_key)
response = s3_client.generate_presigned_url(
"get_object",
Params={
"Bucket": object_storage_config.bucket_name.get_secret_value(),
"Key": image.object_key,
"ResponseContentDisposition": f'inline; filename="{image.file_name}"',
"ResponseContentType": "application/octet-stream",
},
ExpiresIn=object_storage_config.presigned_url_expiry_seconds,
)
Expand Down

0 comments on commit 7a81600

Please sign in to comment.