Skip to content

Commit 66c0faf

Browse files
committed
Bugfix: Get list of batch IDs a different way
1 parent 6436344 commit 66c0faf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

batch_mailchimp/batches_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ def bulk_run(self):
119119
return self._batches
120120

121121
def delete_all(self, refresh=False, **kwargs):
122-
if refresh:
123-
self.list(refresh=refresh)
124-
batch_ids = list(self._batches.keys())
122+
batches = self.list(refresh=refresh)
123+
batch_ids = [batch.batch_id for batch in batches]
125124
for batch_id in batch_ids:
126125
self.delete_request(batch_id)
127126
return self._batches

0 commit comments

Comments
 (0)