提交题目的时候增加对比赛状态的判断

This commit is contained in:
virusdefender
2015-08-24 03:37:25 +08:00
parent 76b28f2da2
commit c06626cbc1

View File

@@ -173,6 +173,8 @@ class ContestSubmissionAPIView(APIView):
contest = Contest.objects.get(id=data["contest_id"])
except Contest.DoesNotExist:
return error_response(u"比赛不存在")
if contest.status != 0:
return error_response(u"比赛已经结束或者还没有开始")
try:
problem = ContestProblem.objects.get(contest=contest, id=data["problem_id"])
# 更新题目提交计数器