fix linter

This commit is contained in:
Yansong Zhang 2025-10-14 11:39:56 +08:00
parent 5e2b0d7b39
commit b8a29bfb35
3 changed files with 4 additions and 8 deletions

View File

@ -120,4 +120,4 @@ class InvokeRateLimitError(BaseHTTPException):
class NeedAddIdsError(BaseHTTPException):
error_code = "need_add_ids"
description = "Need to add ids."
code = 400
code = 400

View File

@ -25,11 +25,7 @@ def _load_app_model(app_id: str) -> App | None:
def _load_app_model_with_trial(app_id: str) -> App | None:
assert isinstance(current_user, Account)
app_model = (
db.session.query(App)
.where(App.id == app_id, App.status == "normal")
.first()
)
app_model = db.session.query(App).where(App.id == app_id, App.status == "normal").first()
return app_model
@ -112,4 +108,4 @@ def get_app_model_with_trial(view: Callable[P, R] | None = None, *, mode: Union[
if view is None:
return decorator
else:
return decorator(view)
return decorator(view)

View File

@ -475,7 +475,7 @@ class DatasetListApi(Resource):
page = request.args.get("page", default=1, type=int)
limit = request.args.get("limit", default=20, type=int)
ids = request.args.getlist("ids")
tenant_id = app_model.tenant_id
if ids:
datasets, total = DatasetService.get_datasets_by_ids(ids, tenant_id)