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