From 4051351e9c3fdc428673389aed4642d752d3c9ee Mon Sep 17 00:00:00 2001 From: Anikesh Suresh Date: Tue, 14 Jan 2025 10:40:04 +0000 Subject: [PATCH] reformat line #81 --- object_storage_api/services/image.py | 2 +- object_storage_api/stores/image.py | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/object_storage_api/services/image.py b/object_storage_api/services/image.py index 147b73a..9e4127c 100644 --- a/object_storage_api/services/image.py +++ b/object_storage_api/services/image.py @@ -130,7 +130,7 @@ def update(self, image_id: str, image: ImagePatchMetadataSchema) -> ImageMetadat f"Patch filename extension `{image.file_name}` does not match" f"stored image `{stored_image.file_name}`" ) - + update_primary = image.primary is not None and image.primary is True and stored_image.primary is False updated_image = self._image_repository.update( image_id=image_id, diff --git a/object_storage_api/stores/image.py b/object_storage_api/stores/image.py index bd6cf11..31ea881 100644 --- a/object_storage_api/stores/image.py +++ b/object_storage_api/stores/image.py @@ -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. @@ -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, )