Skip to content

Commit

Permalink
Fixing response parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-widmann committed May 21, 2024
1 parent 1c94c47 commit c98af54
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions guillotina_s3storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c98af54

Please sign in to comment.