Skip to content

Commit

Permalink
DCUC-25_문제 삭제시 제출물이 우선 삭제되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hijae committed Jul 14, 2022
1 parent c686b5f commit 6e93097
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions problem/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ def delete(self, request):
return self.error("Problem does not exists")
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")

Submission.objects.filter(problem=problem).delete()
return self.error("관련 제출물이 삭제되었습니다. 문제도 삭제하시려면 삭제버튼을 한번 더 눌러주세요.")
#d = os.path.join(settings.TEST_CASE_DIR, problem.test_case_id)
#if os.path.isdir(d):
# shutil.rmtree(d, ignore_errors=True)
Expand Down

0 comments on commit 6e93097

Please sign in to comment.