From f0a70c3b0942ebaae6805686c69e3f36aaf86008 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Tue, 22 Sep 2015 14:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- submission/views.py | 8 +++++--- template/src/oj/problem/my_submissions_list.html | 1 - template/src/oj/submission/my_submissions_list.html | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/submission/views.py b/submission/views.py index 88c6d0dc..c0487e51 100644 --- a/submission/views.py +++ b/submission/views.py @@ -161,11 +161,13 @@ def my_submission_list_page(request, page=1): """ 我的所有提交的列表页 """ - submissions = Submission.objects.filter(user_id=request.user.id, contest_id__isnull=True). \ - values("id", "user_id", "problem_id", "result", "create_time", "accepted_answer_time", "language").order_by("-create_time") - # 显示所有人的提交 这是管理员的调试功能 show_all = request.GET.get("show_all", False) == "true" + if show_all: + submissions = Submission.objects.filter(contest_id__isnull=True) + else: + submissions = Submission.objects.filter(user_id=request.user.id, contest_id__isnull=True) + submissions = submissions.values("id", "user_id", "problem_id", "result", "create_time", "accepted_answer_time", "language").order_by("-create_time") language = request.GET.get("language", None) filter = None diff --git a/template/src/oj/problem/my_submissions_list.html b/template/src/oj/problem/my_submissions_list.html index 4f69d6fd..faa9d628 100644 --- a/template/src/oj/problem/my_submissions_list.html +++ b/template/src/oj/problem/my_submissions_list.html @@ -29,7 +29,6 @@