From b397c4add28807a8a70ab74afcc79894d1ae5d68 Mon Sep 17 00:00:00 2001 From: yuetsh <51725939@qq.com> Date: Tue, 2 Jul 2024 22:38:57 +0800 Subject: [PATCH] fix --- comment/views/admin.py | 4 ++-- oj/urls.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/comment/views/admin.py b/comment/views/admin.py index 64753cd..23d8249 100644 --- a/comment/views/admin.py +++ b/comment/views/admin.py @@ -9,14 +9,14 @@ class CommentAPI(APIView): @super_admin_required def get(self, request): comments = Comment.objects.select_related("problem").exclude(content="") - problem_id = request.GET.get("problem_id") + problem_id = request.GET.get("problem") if problem_id: try: # 这里如果题目不可见,也需要显示该题目的评论 problem = Problem.objects.get(_id=problem_id, contest_id__isnull=True) except Problem.DoesNotExist: return self.error("Problem doesn't exist") - comments = comments.filter(problem=problem) + comments = comments.filter(problem=problem) return self.success( self.paginate_data(request, comments, CommentListSerializer) ) diff --git a/oj/urls.py b/oj/urls.py index 2b1dd42..82e2f60 100644 --- a/oj/urls.py +++ b/oj/urls.py @@ -16,5 +16,5 @@ urlpatterns = [ path("api/admin/", include("utils.urls")), path("api/", include("message.urls.oj")), path("api/", include("comment.urls.oj")), - path("api/admin", include("comment.urls.admin")), + path("api/admin/", include("comment.urls.admin")), ]