diff --git a/guillotina_s3storage/storage.py b/guillotina_s3storage/storage.py index 6f54af5..64b6ce8 100644 --- a/guillotina_s3storage/storage.py +++ b/guillotina_s3storage/storage.py @@ -465,10 +465,11 @@ async def delete_blobs(self, keys: List[str], bucket_name: Optional[str] = None) } } - raw_response = await client.delete_objects(**args) - response = raw_response.json() - success_keys = [o["Key"] for o in response["Deleted"]] - failed_keys = [o["Key"] for o in response["Errors"]] + response = await client.delete_objects(**args) + success_blobs = response.get("Deleted", []) + success_keys = [o["Key"] for o in success_blobs] + failed_blobs = response.get("Errors", []) + failed_keys = [o["Key"] for o in failed_blobs] return success_keys, failed_keys