mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
修复比赛已经结束还能提交题目的 bug
This commit is contained in:
parent
f468f17e07
commit
2868356048
@ -91,6 +91,10 @@ def check_user_contest_permission(func):
|
|||||||
return render(request, "oj/contest/no_contest_permission.html",
|
return render(request, "oj/contest/no_contest_permission.html",
|
||||||
{"reason": "contest_not_start", "show_tab": False, "contest": contest})
|
{"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 func(*args, **kwargs)
|
||||||
|
|
||||||
return _check_user_contest_permission
|
return _check_user_contest_permission
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user