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, ) diff --git a/test/unit/stores/test_image.py b/test/unit/stores/test_image.py index 86d4be8..936ee73 100644 --- a/test/unit/stores/test_image.py +++ b/test/unit/stores/test_image.py @@ -151,7 +151,6 @@ def check_create_presigned_get_success(self) -> None: "Bucket": object_storage_config.bucket_name.get_secret_value(), "Key": self._image_out.object_key, "ResponseContentDisposition": f'inline; filename="{self._image_out.file_name}"', - "ResponseContentType": "application/octet-stream", }, ExpiresIn=object_storage_config.presigned_url_expiry_seconds, )