[Django]-Removing unused lookup_field generated from router on viewset

-3👍

You can try it

class ClientProfileDetail(mixins.UpdateModelMixin, viewsets.GenericViewSet):
    permission_classes = [IsOwnerOrAdmin]
    queryset = ClientProfile.objects.all()
    serializer_class = ClientProfileSerializer

    def get(request, *args, **kwargs):
       serilizer = self.serializer_class(request.user, many=False)
       return Response(serilizer.data)

Leave a comment