def get_serializer(self, instance=None, data=None, many=False, partial=False):
    """If request is not PUT, allow partial updates."""
if self.request.method == 'PUT':
    return UserSerializer(instance=instance, data=data, many=many, partial=True
        )
Django rest framework nested serializer partial update