Skip to content

Commit

Permalink
Add condition to ignore empty bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslinhares committed Dec 21, 2023
1 parent d8dbadf commit 050c193
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions temba/archives/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def iter_records(self, *, where: dict = None):

if where:
bucket, key = self.get_storage_location()
# if bucket == "":
if not bucket:
return

response = s3_client.select_object_content(
Bucket=bucket,
Key=key,
Expand All @@ -206,6 +210,8 @@ def generator():

else:
bucket, key = self.get_storage_location()
if not bucket:
return
s3_obj = s3_client.get_object(Bucket=bucket, Key=key)
return jsonlgz_iterate(s3_obj["Body"])

Expand Down

0 comments on commit 050c193

Please sign in to comment.