def create(self, validated_data):
        user = validated_data['user']
        auth = Auth(user)
        node = validated_data['node']
        target_id = self.context['request'].data.get('id')

        try:
            target = self.get_target(node._id, target_id)
        except __HOLE__:
            raise InvalidModelValueError(
                source={'pointer': '/data/relationships/target/data/id'},
                detail='Invalid comment target \'{}\'.'.format(target_id)
            )
        validated_data['target'] = target
        validated_data['content'] = validated_data.pop('get_content')
        try:
            comment = Comment.create(auth=auth, **validated_data)
        except PermissionsError:
            raise PermissionDenied('Not authorized to comment on this project.')
        return comment
dataset/ETHPy150Open CenterForOpenScience/osf.io/api/comments/serializers.py/CommentCreateSerializer.create