From 9bd8758643a54214853bc984532dfb4e62bee811 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 24 Jan 2022 08:33:41 +0900 Subject: [PATCH] Remove unused CommentListDoc API --- backend/api/urls.py | 5 ----- backend/api/views/comment.py | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/backend/api/urls.py b/backend/api/urls.py index 79885d28..b1fac0e1 100644 --- a/backend/api/urls.py +++ b/backend/api/urls.py @@ -115,11 +115,6 @@ urlpatterns_project = [ view=tag.TagDetail.as_view(), name='tag_detail' ), - path( - route='examples//comments', - view=comment.CommentListDoc.as_view(), - name='comment_list_doc' - ), path( route='comments', view=comment.CommentList.as_view(), diff --git a/backend/api/views/comment.py b/backend/api/views/comment.py index 168da5b7..727637e4 100644 --- a/backend/api/views/comment.py +++ b/backend/api/views/comment.py @@ -10,23 +10,6 @@ from ..permissions import IsOwnComment from ..serializers import CommentSerializer -class CommentListDoc(generics.ListCreateAPIView): - pagination_class = None - permission_classes = [IsAuthenticated & IsInProjectOrAdmin] - serializer_class = CommentSerializer - model = Comment - - def get_queryset(self): - queryset = self.model.objects.filter( - example__project_id=self.kwargs['project_id'], - example=self.kwargs['example_id'] - ) - return queryset - - def perform_create(self, serializer): - serializer.save(example_id=self.kwargs['example_id'], user=self.request.user) - - class CommentList(generics.ListCreateAPIView): permission_classes = [IsAuthenticated & IsInProjectOrAdmin] serializer_class = CommentSerializer