mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
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.
This commit is contained in:
parent
3a6901e718
commit
03cd16fc44
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user