-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Description
Checklist
version:
django 2.2
django rest framework 3.10.3
Steps to reproduce
Example code is follow:
user Autoschema
class TrainGropMemberModifyViewSet(viewsets.ModelViewSet):
def get_serializer_class(self):
if self.request.method == 'PATCH':
return TrainGropListSerializer
if self.request.method == 'PUT':
return TrainGroupModifySerializer
Expected behavior
get shcema
Actual behavior
File "H:\trian\whlrest\traingroup\api.py", line 34, in get_serializer_class
if self.request.method == 'PATCH':
AttributeError: 'NoneType' object has no attribute 'method'
when i use drf_yasg, drf_yasg can return correct schema.