fix: 终审修复——test_case_id 格式校验、modify 空变更报错、异常兜底与文档补充

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 06:26:00 -06:00
parent 67079b5304
commit 5af9d67fe2
5 changed files with 7 additions and 2 deletions

View File

@@ -238,7 +238,7 @@ class ProblemBase(APIView):
if not keys:
return "题目没有任何测试点"
input_name = info["test_cases"][keys[0]]["input_name"]
except (KeyError, AttributeError):
except (KeyError, AttributeError, TypeError):
return "测试点信息损坏,请重新上传测试点"
try:
with open(os.path.join(test_case_dir, input_name), encoding="utf-8") as f: