2017-05-10 09:20:52 +00:00
|
|
|
from __future__ import absolute_import, unicode_literals
|
2017-05-08 09:29:01 +00:00
|
|
|
from celery import shared_task
|
2018-05-20 00:20:17 +00:00
|
|
|
|
|
|
|
from account.models import User
|
|
|
|
from submission.models import Submission
|
2017-05-10 09:20:52 +00:00
|
|
|
from judge.dispatcher import JudgeDispatcher
|
2017-05-08 09:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
2017-05-10 09:20:52 +00:00
|
|
|
def judge_task(submission_id, problem_id):
|
2018-05-20 00:20:17 +00:00
|
|
|
uid = Submission.objects.get(id=submission_id).user_id
|
|
|
|
if User.objects.get(id=uid).is_disabled:
|
|
|
|
return
|
2017-05-10 09:20:52 +00:00
|
|
|
JudgeDispatcher(submission_id, problem_id).judge()
|