mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 08:59:54 +03:00
Allow context to be provided to get_serializer
This commit is contained in:
parent
4ad73d4b9d
commit
d1a3995f5c
|
@ -106,7 +106,7 @@ class GenericAPIView(views.APIView):
|
||||||
deserializing input, and for serializing output.
|
deserializing input, and for serializing output.
|
||||||
"""
|
"""
|
||||||
serializer_class = self.get_serializer_class()
|
serializer_class = self.get_serializer_class()
|
||||||
kwargs['context'] = self.get_serializer_context()
|
kwargs.setdefault('context', self.get_serializer_context())
|
||||||
return serializer_class(*args, **kwargs)
|
return serializer_class(*args, **kwargs)
|
||||||
|
|
||||||
def get_serializer_class(self):
|
def get_serializer_class(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user