Merge pull request #102 from QingdaoU/delete_user_output
migration to delete user output
This commit is contained in:
@@ -117,7 +117,7 @@ class JudgeDispatcher(DispatcherBase):
|
|||||||
return
|
return
|
||||||
self.submission.statistic_info["score"] = score
|
self.submission.statistic_info["score"] = score
|
||||||
|
|
||||||
def judge(self, output=True):
|
def judge(self):
|
||||||
server = self.choose_judge_server()
|
server = self.choose_judge_server()
|
||||||
if not server:
|
if not server:
|
||||||
data = {"submission_id": self.submission.id, "problem_id": self.problem.id}
|
data = {"submission_id": self.submission.id, "problem_id": self.problem.id}
|
||||||
@@ -145,7 +145,7 @@ class JudgeDispatcher(DispatcherBase):
|
|||||||
"max_cpu_time": self.problem.time_limit,
|
"max_cpu_time": self.problem.time_limit,
|
||||||
"max_memory": 1024 * 1024 * self.problem.memory_limit,
|
"max_memory": 1024 * 1024 * self.problem.memory_limit,
|
||||||
"test_case_id": self.problem.test_case_id,
|
"test_case_id": self.problem.test_case_id,
|
||||||
"output": output,
|
"output": False,
|
||||||
"spj_version": self.problem.spj_version,
|
"spj_version": self.problem.spj_version,
|
||||||
"spj_config": spj_config.get("config"),
|
"spj_config": spj_config.get("config"),
|
||||||
"spj_compile_config": spj_config.get("compile"),
|
"spj_compile_config": spj_config.get("compile"),
|
||||||
|
|||||||
24
submission/migrations/0009_delete_user_output.py
Normal file
24
submission/migrations/0009_delete_user_output.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
def delete_user_output(apps, schema_editor):
|
||||||
|
Submission = apps.get_model("submission", "Submission")
|
||||||
|
for item in Submission.objects.all():
|
||||||
|
if "data" in item.info and isinstance(item.info["data"], list):
|
||||||
|
for index in range(len(item.info["data"])):
|
||||||
|
item.info["data"][index]["output"] = ""
|
||||||
|
item.save()
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('submission', '0008_submission_ip'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(delete_user_output, reverse_code=migrations.RunPython.noop)
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user