mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
增加上传测试用例的时候对空文件的判断
This commit is contained in:
parent
f263e05746
commit
6a172f53f7
@ -191,6 +191,8 @@ class TestCaseUploadAPIView(APIView):
|
|||||||
name_list = test_case_file.namelist()
|
name_list = test_case_file.namelist()
|
||||||
|
|
||||||
# 如果文件是直接打包的,那么name_list 就是["1.in", "1.out"]这样的
|
# 如果文件是直接打包的,那么name_list 就是["1.in", "1.out"]这样的
|
||||||
|
if len(name_list) == 0:
|
||||||
|
return error_response(u"压缩包内没有文件")
|
||||||
|
|
||||||
if len(name_list) % 2 == 1:
|
if len(name_list) % 2 == 1:
|
||||||
return error_response(u"测试用例文件格式错误,文件数目为奇数")
|
return error_response(u"测试用例文件格式错误,文件数目为奇数")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user