Allow passing inline to not only GET requests.
This commit is contained in:
parent
a72543f6c9
commit
ca7d7dfd12
@ -67,7 +67,7 @@ class CollectionViewSet(BaseViewSet):
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
inline = self.request.method == 'GET' and 'inline' in self.request.query_params
|
||||
inline = 'inline' in self.request.query_params
|
||||
context.update({'request': self.request, 'inline': inline})
|
||||
return context
|
||||
|
||||
@ -118,7 +118,7 @@ class CollectionItemViewSet(BaseViewSet):
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
inline = self.request.method == 'GET' and 'inline' in self.request.query_params
|
||||
inline = 'inline' in self.request.query_params
|
||||
context.update({'request': self.request, 'inline': inline})
|
||||
return context
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user