修复刚刚提交的错误
This commit is contained in:
@@ -258,10 +258,10 @@ class ContestPasswordVerifyAPIView(APIView):
|
|||||||
try:
|
try:
|
||||||
contest = Contest.objects.get(id=data["contest_id"], contest_type=2)
|
contest = Contest.objects.get(id=data["contest_id"], contest_type=2)
|
||||||
except Contest.DoesNotExist:
|
except Contest.DoesNotExist:
|
||||||
return error_response(u"密码错误")
|
return error_response(u"比赛不存在")
|
||||||
|
|
||||||
if data["password"] != contest.password:
|
if data["password"] != contest.password:
|
||||||
return error_response(u" 密码错误")
|
return error_response(u"密码错误")
|
||||||
else:
|
else:
|
||||||
if "contests" not in request.session:
|
if "contests" not in request.session:
|
||||||
request.session["contests"] = []
|
request.session["contests"] = []
|
||||||
@@ -279,10 +279,7 @@ def contest_page(request, contest_id):
|
|||||||
"""
|
"""
|
||||||
单个比赛的详情页
|
单个比赛的详情页
|
||||||
"""
|
"""
|
||||||
try:
|
contest = Contest.objects.get(id=contest_id)
|
||||||
contest = Contest.objects.get(id=contest_id)
|
|
||||||
except Contest.DoesNotExist:
|
|
||||||
return error_page(request, u"比赛不存在")
|
|
||||||
|
|
||||||
return render(request, "oj/contest/contest_index.html", {"contest": contest})
|
return render(request, "oj/contest/contest_index.html", {"contest": contest})
|
||||||
|
|
||||||
@@ -292,10 +289,7 @@ def contest_problem_page(request, contest_id, contest_problem_id):
|
|||||||
"""
|
"""
|
||||||
单个比赛题目的详情页
|
单个比赛题目的详情页
|
||||||
"""
|
"""
|
||||||
try:
|
contest = Contest.objects.get(id=contest_id)
|
||||||
contest = Contest.objects.get(id=contest_id)
|
|
||||||
except Contest.DoesNotExist:
|
|
||||||
return error_page(request, u"比赛不存在")
|
|
||||||
try:
|
try:
|
||||||
contest_problem = ContestProblem.objects.get(id=contest_problem_id, visible=True)
|
contest_problem = ContestProblem.objects.get(id=contest_problem_id, visible=True)
|
||||||
except ContestProblem.DoesNotExist:
|
except ContestProblem.DoesNotExist:
|
||||||
@@ -334,7 +328,7 @@ def contest_problems_list_page(request, contest_id):
|
|||||||
state[item.problem_id] = item.ac
|
state[item.problem_id] = item.ac
|
||||||
for item in contest_problems:
|
for item in contest_problems:
|
||||||
if item.id in state:
|
if item.id in state:
|
||||||
item.ac = state[item.id].ac
|
item.ac = state[item.id]
|
||||||
else:
|
else:
|
||||||
item.ac = 0
|
item.ac = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user