mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 16:12:13 +00:00
删除比赛题目暂时不删除测试用例
This commit is contained in:
parent
c392cbd0d9
commit
0401468ff3
@ -430,9 +430,9 @@ class ContestProblemAPI(ProblemBase):
|
||||
ensure_created_by(problem.contest, request.user)
|
||||
if Submission.objects.filter(problem=problem).exists():
|
||||
return self.error("Can't delete the problem as it has submissions")
|
||||
d = os.path.join(settings.TEST_CASE_DIR, problem.test_case_id)
|
||||
if os.path.isdir(d):
|
||||
shutil.rmtree(d, ignore_errors=True)
|
||||
# d = os.path.join(settings.TEST_CASE_DIR, problem.test_case_id)
|
||||
# if os.path.isdir(d):
|
||||
# shutil.rmtree(d, ignore_errors=True)
|
||||
problem.delete()
|
||||
return self.success()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user