Skip to content

Commit 6f7adbb

Browse files
committed
Sort batches by submitted_at timestamp
1 parent 1e1f780 commit 6f7adbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

batch_mailchimp/batches_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def list(self, refresh=False, **kwargs):
154154
self._batches[batch_data["id"]].update(**batch_data)
155155
else:
156156
self._batches[batch_data["id"]] = Batch(self, **batch_data)
157+
self._batches = sorted(self._batches, key=lambda x: x.submitted_at)
157158
return self._batches
158159

159160
@no_batch

0 commit comments

Comments
 (0)