From c98af54ecc55b6f73663e2e852b8ea66b7b0454b Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 21 May 2024 14:23:36 -0400 Subject: [PATCH] Fixing response parsing --- guillotina_s3storage/storage.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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