diff --git a/submission/views.py b/submission/views.py index 6399e22..daac6f6 100644 --- a/submission/views.py +++ b/submission/views.py @@ -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"]) # 更新题目提交计数器