From 03cd16fc444804ad9dca0f828d39a898e76e2f81 Mon Sep 17 00:00:00 2001 From: GareArc Date: Tue, 5 May 2026 20:10:51 -0700 Subject: [PATCH] refactor(openapi): /account/sessions uses MAX_PAGE_LIMIT Drops the magic 200 in favor of the shared constant introduced in Task 1's _models.py rewrite. Behavior unchanged (still caps at 200). Sibling endpoint /apps already wired the constant through AppListQuery in Task 3; this closes the loop on the single-source-of-truth goal. --- api/controllers/openapi/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/openapi/account.py b/api/controllers/openapi/account.py index 7637687efc..76a60a23ea 100644 --- a/api/controllers/openapi/account.py +++ b/api/controllers/openapi/account.py @@ -13,7 +13,7 @@ from sqlalchemy import and_, select, update from werkzeug.exceptions import BadRequest, NotFound from controllers.openapi import openapi_ns -from controllers.openapi._models import PaginationEnvelope +from controllers.openapi._models import MAX_PAGE_LIMIT, PaginationEnvelope from extensions.ext_database import db from extensions.ext_redis import redis_client from libs.oauth_bearer import ( @@ -84,7 +84,7 @@ class AccountSessionsApi(Resource): ctx = g.auth_ctx now = datetime.now(UTC) page = int(request.args.get("page", "1")) - limit = min(int(request.args.get("limit", "100")), 200) + limit = min(int(request.args.get("limit", "100")), MAX_PAGE_LIMIT) all_rows = db.session.execute( select(