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 @@ {{ forloop.counter }} - {% if show_all %}{{ item.user.username }}{% endif %} {{ item.create_time }} diff --git a/template/src/oj/submission/my_submissions_list.html b/template/src/oj/submission/my_submissions_list.html index 1e9975fd..251c5e8c 100644 --- a/template/src/oj/submission/my_submissions_list.html +++ b/template/src/oj/submission/my_submissions_list.html @@ -52,6 +52,7 @@ {{ forloop.counter |add:start_id }} + {% if show_all %}({{ item.user.username }}){% endif %} {{ item.title }}