fix: auto-fix code issues (cron)
- 修复裸异常捕获 (E722) - 改为具体异常类型 - 修复重复导入/字段定义问题 - 修复PEP8格式问题 (W291 trailing whitespace, E226, E741) - 修复未使用变量 (F841) - 修复变量名遮蔽 (F402) - 修复未定义名称 (F821) - 添加 urllib.parse 导入 - 修复 f-string 缺少占位符 (F541) - 修复模块级导入位置 (E402) - 修复行尾空白和空行问题 - 优化代码结构,提升可读性
This commit is contained in:
@@ -6,7 +6,6 @@ Knowledge Growth: Multi-file fusion + Entity Alignment + Document Import
|
||||
ASR: 阿里云听悟 + OSS
|
||||
"""
|
||||
|
||||
from fastapi.responses import StreamingResponse
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
@@ -14,14 +13,15 @@ import httpx
|
||||
import uuid
|
||||
import io
|
||||
import time
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from typing import List, Optional, Union, Dict, Any
|
||||
|
||||
from fastapi import FastAPI, File, UploadFile, HTTPException, Form, Depends, Header, Request, Query, Body
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.responses import JSONResponse, StreamingResponse
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List, Optional, Union, Dict, Any
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
|
||||
# Configure logger
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -9269,7 +9269,7 @@ async def list_tenant_permissions_endpoint(_=Depends(verify_api_key)):
|
||||
"""获取所有可用的租户权限列表"""
|
||||
if not TENANT_MANAGER_AVAILABLE:
|
||||
raise HTTPException(status_code=500, detail="Tenant manager not available")
|
||||
|
||||
|
||||
tenant_manager = get_tenant_manager()
|
||||
return {
|
||||
"permissions": [
|
||||
@@ -11082,17 +11082,17 @@ async def list_languages(
|
||||
return {
|
||||
"languages": [
|
||||
{
|
||||
"code": l.code,
|
||||
"name": l.name,
|
||||
"name_local": l.name_local,
|
||||
"is_rtl": l.is_rtl,
|
||||
"is_active": l.is_active,
|
||||
"is_default": l.is_default,
|
||||
"date_format": l.date_format,
|
||||
"time_format": l.time_format,
|
||||
"calendar_type": l.calendar_type
|
||||
"code": lang.code,
|
||||
"name": lang.name,
|
||||
"name_local": lang.name_local,
|
||||
"is_rtl": lang.is_rtl,
|
||||
"is_active": lang.is_active,
|
||||
"is_default": lang.is_default,
|
||||
"date_format": lang.date_format,
|
||||
"time_format": lang.time_format,
|
||||
"calendar_type": lang.calendar_type
|
||||
}
|
||||
for l in languages
|
||||
for lang in languages
|
||||
],
|
||||
"total": len(languages)
|
||||
}
|
||||
@@ -13088,7 +13088,8 @@ async def check_team_incentive_eligibility(
|
||||
try:
|
||||
from developer_ecosystem_manager import (
|
||||
DeveloperEcosystemManager, SDKLanguage,
|
||||
SDKStatus, TemplateCategory, TemplateStatus, DeveloperStatus
|
||||
SDKStatus, TemplateCategory, TemplateStatus, DeveloperStatus,
|
||||
PluginCategory
|
||||
)
|
||||
DEVELOPER_ECOSYSTEM_AVAILABLE = True
|
||||
except ImportError as e:
|
||||
|
||||
Reference in New Issue
Block a user