dispatch/api/serializers.py
def sanitize_block(self, block):
        """Santizes the data for the given block.
        If block has a matching embed serializer, use the `to_internal_value` method."""

        embed_type = block.get('type', None)
        data = block.get('data', {})
        serializer = self.serializers.get(embed_type, None)

        if serializer is None:
            return block

        block['data'] = serializer.to_internal_value(data)

        return block
def sanitize_block(self, block):
        """Santizes the data for the given block.
        If block has a matching embed serializer, use the `to_internal_value` method."""

        embed_type = block.get('type', None)
        data = block.get('data', {})
        serializer = self.serializers.get(embed_type, None)

        if serializer is None:
            return block

        block['data'] = serializer.to_internal_value(data)

        return block
def sanitize_block ( self , block ) : embed_type = block . get ( 'type' , None ) data = block . get ( 'data' , { } ) serializer = self . serializers . get ( embed_type , None ) if serializer is None : return block block [ 'data' ] = serializer . to_internal_value ( data ) return block
Santizes the data for the given block.
        If block has a matching embed serializer, use the `to_internal_value` method.
Santizes the data for the given block . If block has a matching embed serializer use the to_internal_value method .