From 99c9475ff73ed62a22cd65998164c97a6d5134cb Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Thu, 16 Mar 2023 11:09:03 -0500 Subject: [PATCH] Don't remove file after judging on output-only --- judge/bridge/judge_handler.py | 10 +++++----- judge/forms.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/judge/bridge/judge_handler.py b/judge/bridge/judge_handler.py index d81cafa..06db794 100644 --- a/judge/bridge/judge_handler.py +++ b/judge/bridge/judge_handler.py @@ -571,11 +571,11 @@ class JudgeHandler(ZlibPacketHandler): self._post_update_submission(submission.id, "grading-end", done=True) # Clean up submission source file (if any) - source_file = cache.get(f"submission_source_file:{submission.id}") - if source_file: - filepath = os.path.join(settings.DMOJ_SUBMISSION_ROOT, source_file) - if os.path.exists(filepath): - os.remove(filepath) + # source_file = cache.get(f"submission_source_file:{submission.id}") + # if source_file: + # filepath = os.path.join(settings.DMOJ_SUBMISSION_ROOT, source_file) + # if os.path.exists(filepath): + # os.remove(filepath) def on_compile_error(self, packet): logger.info( diff --git a/judge/forms.py b/judge/forms.py index dd17bb4..5168240 100644 --- a/judge/forms.py +++ b/judge/forms.py @@ -119,9 +119,9 @@ class ProfileForm(ModelForm): def file_size_validator(file): - limit = 10 * 1024 * 1024 + limit = 1 * 1024 * 1024 if file.size > limit: - raise ValidationError("File too large. Size should not exceed 10MB.") + raise ValidationError("File too large. Size should not exceed 1MB.") class ProblemSubmitForm(ModelForm):