From e9eafdaf1a87abf64ffec5e85e4cbd44e13c927a Mon Sep 17 00:00:00 2001 From: "xiaozhe.ma" Date: Mon, 22 Jul 2024 18:00:03 +0900 Subject: [PATCH] =?UTF-8?q?bug534:=E3=82=A2=E3=83=97=E3=83=AA=E6=9C=80?= =?UTF-8?q?=E5=A4=A7100=E4=BB=B6=E8=B6=85=E3=81=88=E3=82=8B=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AE=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/api_v1/routers/kintone.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/backend/app/api/api_v1/routers/kintone.py b/backend/app/api/api_v1/routers/kintone.py index 44fab0d..d564af9 100644 --- a/backend/app/api/api_v1/routers/kintone.py +++ b/backend/app/api/api_v1/routers/kintone.py @@ -517,20 +517,17 @@ async def allapps(request:Request,c:config.KINTONE_ENV=Depends(getkintoneenv)): headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} url = f"{c.BASE_URL}{config.API_V1_STR}/apps.json" offset = 0 + limit = 100 all_apps = [] while True: - r = httpx.get(f"{url}?limit=100&offset={offset}", headers=headers) + r = httpx.get(f"{url}?limit={limit}&offset={offset}", headers=headers) json_data = r.json() - if "apps" in json_data: - all_apps.extend(json_data["apps"]) - if len(json_data["apps"]) == 100: - offset += 100 - else: - break - else: - break - + apps = json_data.get("apps",[]) + all_apps.extend(apps) + if len(apps)