mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 16:12:13 +00:00
23 lines
785 B
Python
23 lines
785 B
Python
from account.decorators import super_admin_required
|
|
from judge.tasks import judge_task
|
|
# from judge.dispatcher import JudgeDispatcher
|
|
from utils.api import APIView
|
|
from ..models import Submission
|
|
|
|
|
|
class SubmissionRejudgeAPI(APIView):
|
|
@super_admin_required
|
|
def get(self, request):
|
|
id = request.GET.get("id")
|
|
if not id:
|
|
return self.error("Parameter error, id is required")
|
|
try:
|
|
submission = Submission.objects.select_related("problem").get(id=id, contest_id__isnull=True)
|
|
except Submission.DoesNotExist:
|
|
return self.error("Submission does not exists")
|
|
submission.statistic_info = {}
|
|
submission.save()
|
|
|
|
judge_task.send(submission.id, submission.problem.id)
|
|
return self.success()
|