fix: remove redundant local AppRelease import causing NameError in draft_run

This commit is contained in:
wxy
2026-03-18 17:36:43 +08:00
parent f042f44501
commit e24217a6ba

View File

@@ -520,7 +520,7 @@ async def draft_run(
# 提前验证和准备(在流式响应开始前完成) # 提前验证和准备(在流式响应开始前完成)
from app.services.app_service import AppService from app.services.app_service import AppService
from app.services.multi_agent_service import MultiAgentService from app.services.multi_agent_service import MultiAgentService
from app.models import AgentConfig, ModelConfig from app.models import AgentConfig, ModelConfig, AppRelease
from sqlalchemy import select from sqlalchemy import select
from app.core.exceptions import BusinessException from app.core.exceptions import BusinessException
from app.services.draft_run_service import AgentRunService from app.services.draft_run_service import AgentRunService
@@ -742,7 +742,6 @@ async def draft_run(
if is_shared: if is_shared:
if not app.current_release_id: if not app.current_release_id:
raise BusinessException("该应用尚未发布,无法使用", BizCode.AGENT_CONFIG_MISSING) raise BusinessException("该应用尚未发布,无法使用", BizCode.AGENT_CONFIG_MISSING)
from app.models import AppRelease
release = db.get(AppRelease, app.current_release_id) release = db.get(AppRelease, app.current_release_id)
if not release: if not release:
raise BusinessException("发布版本不存在", BizCode.AGENT_CONFIG_MISSING) raise BusinessException("发布版本不存在", BizCode.AGENT_CONFIG_MISSING)