From 86b0bfe932da48f26e59ab03a275ba0716715b9d Mon Sep 17 00:00:00 2001 From: Ayan Banerjee Date: Mon, 18 Jan 2021 19:38:41 +0530 Subject: [PATCH] endpoints.py: Update response at each iteration Without this same response will be fetched every time thus creating an infinite loop. --- drchrono/endpoints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drchrono/endpoints.py b/drchrono/endpoints.py index 9914893a..8b5889ac 100644 --- a/drchrono/endpoints.py +++ b/drchrono/endpoints.py @@ -103,6 +103,8 @@ def list(self, params=None, **kwargs): url = data['next'] # Same as the resource URL, but with the page query parameter present for result in data['results']: yield result + if url: + response = requests.get(url, params=params, **kwargs) else: exe = ERROR_CODES.get(response.status_code, APIException) self.logger.debug("list exception {}".format(exe))