From 19530e880ae7de50d733679d1b281a598e3115bc Mon Sep 17 00:00:00 2001 From: lif <1835304752@qq.com> Date: Wed, 1 Apr 2026 06:52:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20clean=20redundant=20type=20ign?= =?UTF-8?q?ore=20in=20request=20query=20parsing=20=F0=9F=A4=96=F0=9F=A4=96?= =?UTF-8?q?=F0=9F=A4=96=20(#34350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/console/billing/billing.py | 2 +- api/controllers/console/billing/compliance.py | 2 +- api/controllers/console/workspace/account.py | 2 +- api/controllers/console/workspace/model_providers.py | 4 ++-- api/controllers/console/workspace/workspace.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/controllers/console/billing/billing.py b/api/controllers/console/billing/billing.py index ac039f9c5d..23c01eedb1 100644 --- a/api/controllers/console/billing/billing.py +++ b/api/controllers/console/billing/billing.py @@ -36,7 +36,7 @@ class Subscription(Resource): @only_edition_cloud def get(self): current_user, current_tenant_id = current_account_with_tenant() - args = SubscriptionQuery.model_validate(request.args.to_dict(flat=True)) # type: ignore + args = SubscriptionQuery.model_validate(request.args.to_dict(flat=True)) BillingService.is_tenant_owner_or_admin(current_user) return BillingService.get_subscription(args.plan, args.interval, current_user.email, current_tenant_id) diff --git a/api/controllers/console/billing/compliance.py b/api/controllers/console/billing/compliance.py index afc5f92b68..b5a08e0791 100644 --- a/api/controllers/console/billing/compliance.py +++ b/api/controllers/console/billing/compliance.py @@ -31,7 +31,7 @@ class ComplianceApi(Resource): @only_edition_cloud def get(self): current_user, current_tenant_id = current_account_with_tenant() - args = ComplianceDownloadQuery.model_validate(request.args.to_dict(flat=True)) # type: ignore + args = ComplianceDownloadQuery.model_validate(request.args.to_dict(flat=True)) ip_address = extract_remote_ip(request) device_info = request.headers.get("User-Agent", "Unknown device") diff --git a/api/controllers/console/workspace/account.py b/api/controllers/console/workspace/account.py index dcd4438b67..626d330e9d 100644 --- a/api/controllers/console/workspace/account.py +++ b/api/controllers/console/workspace/account.py @@ -519,7 +519,7 @@ class EducationAutoCompleteApi(Resource): @cloud_edition_billing_enabled @marshal_with(data_fields) def get(self): - payload = request.args.to_dict(flat=True) # type: ignore + payload = request.args.to_dict(flat=True) args = EducationAutocompleteQuery.model_validate(payload) return BillingService.EducationIdentity.autocomplete(args.keywords, args.page, args.limit) diff --git a/api/controllers/console/workspace/model_providers.py b/api/controllers/console/workspace/model_providers.py index 8e0aefc9e3..cbb9677309 100644 --- a/api/controllers/console/workspace/model_providers.py +++ b/api/controllers/console/workspace/model_providers.py @@ -99,7 +99,7 @@ class ModelProviderListApi(Resource): _, current_tenant_id = current_account_with_tenant() tenant_id = current_tenant_id - payload = request.args.to_dict(flat=True) # type: ignore + payload = request.args.to_dict(flat=True) args = ParserModelList.model_validate(payload) model_provider_service = ModelProviderService() @@ -118,7 +118,7 @@ class ModelProviderCredentialApi(Resource): _, current_tenant_id = current_account_with_tenant() tenant_id = current_tenant_id # if credential_id is not provided, return current used credential - payload = request.args.to_dict(flat=True) # type: ignore + payload = request.args.to_dict(flat=True) args = ParserCredentialId.model_validate(payload) model_provider_service = ModelProviderService() diff --git a/api/controllers/console/workspace/workspace.py b/api/controllers/console/workspace/workspace.py index 88fd2c010f..a06b4fd195 100644 --- a/api/controllers/console/workspace/workspace.py +++ b/api/controllers/console/workspace/workspace.py @@ -155,7 +155,7 @@ class WorkspaceListApi(Resource): @setup_required @admin_required def get(self): - payload = request.args.to_dict(flat=True) # type: ignore + payload = request.args.to_dict(flat=True) args = WorkspaceListQuery.model_validate(payload) stmt = select(Tenant).order_by(Tenant.created_at.desc())