Don't remove file after judging on output-only

This commit is contained in:
cuom1999 2023-03-16 11:09:03 -05:00
parent a62df01ecf
commit 99c9475ff7
2 changed files with 7 additions and 7 deletions

View file

@ -571,11 +571,11 @@ class JudgeHandler(ZlibPacketHandler):
self._post_update_submission(submission.id, "grading-end", done=True) self._post_update_submission(submission.id, "grading-end", done=True)
# Clean up submission source file (if any) # Clean up submission source file (if any)
source_file = cache.get(f"submission_source_file:{submission.id}") # source_file = cache.get(f"submission_source_file:{submission.id}")
if source_file: # if source_file:
filepath = os.path.join(settings.DMOJ_SUBMISSION_ROOT, source_file) # filepath = os.path.join(settings.DMOJ_SUBMISSION_ROOT, source_file)
if os.path.exists(filepath): # if os.path.exists(filepath):
os.remove(filepath) # os.remove(filepath)
def on_compile_error(self, packet): def on_compile_error(self, packet):
logger.info( logger.info(

View file

@ -119,9 +119,9 @@ class ProfileForm(ModelForm):
def file_size_validator(file): def file_size_validator(file):
limit = 10 * 1024 * 1024 limit = 1 * 1024 * 1024
if file.size > limit: 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): class ProblemSubmitForm(ModelForm):