Skip to content

Commit

Permalink
fix: fix _download_all_pages handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bnznamco committed Jan 16, 2024
1 parent 6f9e3b7 commit f72d09d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mailupy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def _download_all_pages(self, url):
f'{url}{spacer}pageNumber={current}',
headers=self._default_headers()
).json()
total = math.ceil(data['TotalElementsCount'] / data['PageSize'])
is_paginated = data['IsPaginated']
for item in data['Items']:
total = math.ceil(data.get('TotalElementsCount', 0) / data.get('PageSize', 0))
is_paginated = data.get('IsPaginated', False)
for item in data.get('Items', []):
yield item
current = current + 1

Expand Down

0 comments on commit f72d09d

Please sign in to comment.