修复比赛所有题目列表页面上显示了隐藏问题的 bug

This commit is contained in:
virusdefender
2015-11-06 22:15:32 +08:00
parent de870fffb2
commit 2bfa1aedc0

View File

@@ -291,7 +291,6 @@ class MakeContestProblemPublicAPIView(APIView):
return success_response(u"创建成功")
class ContestPasswordVerifyAPIView(APIView):
@login_required
def post(self, request):
@@ -374,7 +373,7 @@ def contest_problems_list_page(request, contest_id):
比赛所有题目的列表页
"""
contest = Contest.objects.get(id=contest_id)
contest_problems = ContestProblem.objects.filter(contest=contest).select_related("contest").order_by("sort_index")
contest_problems = ContestProblem.objects.filter(contest=contest, visible=True).select_related("contest").order_by("sort_index")
return render(request, "oj/contest/contest_problems_list.html", {"contest_problems": contest_problems,
"contest": {"id": contest_id}})
@@ -466,6 +465,7 @@ class ContestTimeAPIView(APIView):
"""
获取比赛开始或者结束的倒计时,返回毫秒数字
"""
def get(self, request):
contest_id = request.GET.get("contest_id", -1)
try: