Skip to content

Commit

Permalink
imp: use ok property of requests.response
Browse files Browse the repository at this point in the history
  • Loading branch information
amatmv committed Mar 9, 2023
1 parent 89da39e commit 1f21c52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyakeneo/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def get_page_items(self):
def fetch_next_page(self):
"""Return True if a next page exists. Returns False otherwise."""
if self.is_paginated(self._items) and self._link_next:
r = self._session.get(self._link_next)
if r.status_code == requests.codes.ok:
next_page = Result.parse_page(json.loads(r.text))
response = self._session.get(self._link_next)
if response.ok:
next_page = Result.parse_page(json.loads(response.text))
self._items = next_page["items"]
self._count = next_page["count"]
self._link_next = next_page["link_next"]
Expand Down

0 comments on commit 1f21c52

Please sign in to comment.