From 232e68237725cc5b749308b008d4afe88fe3ce22 Mon Sep 17 00:00:00 2001 From: Schalk Date: Mon, 20 May 2024 10:14:04 +0200 Subject: [PATCH] Recommended rearrangement. --- src/api/aaq/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/aaq/__init__.py b/src/api/aaq/__init__.py index 0c7c667..6d91a69 100644 --- a/src/api/aaq/__init__.py +++ b/src/api/aaq/__init__.py @@ -27,10 +27,11 @@ def get_paginated( response.raise_for_status() result = response.json()["result"] response_list.extend(result) - if len(result) == params["limit"]: - params["offset"] += params["limit"] - elif len(result) < params["limit"]: + if len(result) < limit: break + else: + params["offset"] += limit + response_list = [{k: str(v) for k, v in d.items()} for d in response_list]