From 2868356048625359ede21e1da5c9de7c95207fa4 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Mon, 2 Nov 2015 21:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AF=94=E8=B5=9B=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E7=BB=93=E6=9D=9F=E8=BF=98=E8=83=BD=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contest/decorators.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contest/decorators.py b/contest/decorators.py index 2f5e3ba3..93e24fad 100644 --- a/contest/decorators.py +++ b/contest/decorators.py @@ -91,6 +91,10 @@ def check_user_contest_permission(func): return render(request, "oj/contest/no_contest_permission.html", {"reason": "contest_not_start", "show_tab": False, "contest": contest}) + # 比赛已经结束了,只拦截 ajax 的答案提交 + if contest.status == CONTEST_ENDED and request.is_ajax(): + return error_response(u"比赛已经结束") + return func(*args, **kwargs) return _check_user_contest_permission