From ccf084c61e560dceff8d32dec0991627092c387e Mon Sep 17 00:00:00 2001 From: Christian Glatthard Date: Sat, 8 Aug 2015 10:55:57 +0200 Subject: [PATCH] serializer class for ShareDetail was missing --- ipynbsrv/api/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipynbsrv/api/views.py b/ipynbsrv/api/views.py index dbb80d2..13905a3 100644 --- a/ipynbsrv/api/views.py +++ b/ipynbsrv/api/views.py @@ -754,6 +754,11 @@ class ShareDetail(generics.RetrieveUpdateDestroyAPIView): permission_classes = [ShareDetailPermissions] queryset = Share.objects.all() + def get_serializer_class(self, *args, **kwargs): + if self.request.method in ['PATCH', 'POST', 'PUT']: + return FlatShareSerializer + return NestedShareSerializer + @api_view(['POST']) def share_add_access_groups(request, pk):