File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from rest_framework .decorators import action
2- from rest_framework .exceptions import MethodNotAllowed
32from rest_framework .request import Request
43from rest_framework .response import Response
54from rest_framework .viewsets import ModelViewSet
1110)
1211from rest_framework .permissions import IsAuthenticated , IsAuthenticatedOrReadOnly
1312
13+ from django .http import Http404
1414from django .shortcuts import get_object_or_404
1515
1616from problem .problem_details import (
@@ -52,7 +52,7 @@ def get_permissions(self):
5252 return [IsAuthenticatedOrReadOnly ()]
5353
5454 def list (self , request : Request ) -> Response :
55- raise MethodNotAllowed ( request . method )
55+ raise Http404
5656
5757 @action (detail = False , methods = ["get" ], url_path = "first" )
5858 def first (self , request : Request ) -> Response :
You can’t perform that action at this time.
0 commit comments