fix(#1774): 模板不存在明确返回404并收敛双表异常降级逻辑 #1779
Reference in New Issue
Block a user
Delete Branch "fix/issue-1774-template-404"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修复内容
Issue #1774:编辑器创建片段接口对不存在/已删除模板一律返回 400,且双表读取靠三层 try/except 异常降级,生产日志充斥
ValueError: 模板不存在假修复堆栈(27dccf6 遗留)。改动
TemplateNotFoundError,模板不存在/已删除/无权限 → 404;模板存在但未配置片段 → 422(配置错误),替代此前一律 400。_get_template_segments删除「新表异常→直查配置表→旧表 segments」三层降级;片段配置统一由EditTemplateService.list_clip_configs_for_editor显式判定:templates)→template_owned_by校验归属 + is_active 后直接读template_clip_configs;edit_templates)→ 全局可读直接读;TemplateNotFoundError。get_draft_plan_id增加模板存在性/归属/未删除校验(草稿缓存命中也校验),模板删除后不能再借既有草稿 plan 继续操作;回滚端点版本不存在改返 404。ValueError: 模板不存在堆栈噪声。测试
pytest tests/unit/test_editor_clips_random_start.py test_mediakit_smart_clips.py test_get_template_segments_fallback.py test_scene_change_prerender.py test_smart_match_integration.py test_unify_template_segments.py:110 passed关联
Closes #1774
🚀 预览环境已部署
0d19f3944ftobac08c2612🗑️ 预览环境已清理
PR #1779 已关闭或合并,对应的预览环境已被清理。