提交题目的时候增加对比赛状态的判断
This commit is contained in:
@@ -173,6 +173,8 @@ class ContestSubmissionAPIView(APIView):
|
|||||||
contest = Contest.objects.get(id=data["contest_id"])
|
contest = Contest.objects.get(id=data["contest_id"])
|
||||||
except Contest.DoesNotExist:
|
except Contest.DoesNotExist:
|
||||||
return error_response(u"比赛不存在")
|
return error_response(u"比赛不存在")
|
||||||
|
if contest.status != 0:
|
||||||
|
return error_response(u"比赛已经结束或者还没有开始")
|
||||||
try:
|
try:
|
||||||
problem = ContestProblem.objects.get(contest=contest, id=data["problem_id"])
|
problem = ContestProblem.objects.get(contest=contest, id=data["problem_id"])
|
||||||
# 更新题目提交计数器
|
# 更新题目提交计数器
|
||||||
|
|||||||
Reference in New Issue
Block a user