File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 77from rest_framework .response import Response
88from rest_framework .exceptions import NotFound , MethodNotAllowed
99from rest_framework .reverse import reverse
10+ from rest_framework .serializers import Serializer
1011
1112from rest_framework_json_api .exceptions import Conflict
1213from rest_framework_json_api .serializers import ResourceIdentifierObjectSerializer
@@ -18,6 +19,11 @@ class RelationshipView(generics.GenericAPIView):
1819 self_link_view_name = None
1920 related_link_view_name = None
2021
22+ def get_serializer_class (self ):
23+ if getattr (self , 'action' , False ) is None :
24+ return Serializer
25+ return self .serializer_class
26+
2127 def __init__ (self , ** kwargs ):
2228 super (RelationshipView , self ).__init__ (** kwargs )
2329 # We include this simply for dependency injection in tests.
You can’t perform that action at this time.
0 commit comments