streamfield_tools/registry.py
def _verify_block(self, block_type, block):
        """
        Verifies a block prior to registration.
        """
        if block_type in self._registry:
            raise AlreadyRegistered(
                "A block has already been registered to the {} `block_type` "
                "in the registry. Either unregister that block before trying "
                "to register this block under a different `block_type`".format(
                    block_type
                )
            )
        if not isinstance(block, Block):
            raise InvalidBlock(
                "The block you tried register to {} is invalid. Only "
                "instances of `wagtail.wagtailcore.blocks.Block` may be "
                "registered with the the block_registry.".format(block_type)
            )
def _verify_block(self, block_type, block):
        if block_type in self._registry:
            raise AlreadyRegistered(
                "A block has already been registered to the {} `block_type` "
                "in the registry. Either unregister that block before trying "
                "to register this block under a different `block_type`".format(
                    block_type
                )
            )
        if not isinstance(block, Block):
            raise InvalidBlock(
                "The block you tried register to {} is invalid. Only "
                "instances of `wagtail.wagtailcore.blocks.Block` may be "
                "registered with the the block_registry.".format(block_type)
            )
def _verify_block ( self , block_type , block ) : if block_type in self . _registry : raise AlreadyRegistered ( "A block has already been registered to the {} `block_type` " "in the registry. Either unregister that block before trying " "to register this block under a different `block_type`" . format ( block_type ) ) if not isinstance ( block , Block ) : raise InvalidBlock ( "The block you tried register to {} is invalid. Only " "instances of `wagtail.wagtailcore.blocks.Block` may be " "registered with the the block_registry." . format ( block_type ) )
Verifies a block prior to registration.
Verifies a block prior to registration .