my code:
from django.core.validators import RegexValidator
URL_VALIDATOR_MESSAGE = 'Not a valid URL'
URL_VALIDATOR = RegexValidator(regex='http\D+', message=URL_VALIDATOR_MESSAGE)
class SezPubBlock(blocks.StructBlock):
sez = blocks.ListBlock(
blocks.StructBlock(
[
("title", blocks.CharBlock(classname="full title", icon="title", required=True)),
("url", blocks.URLBlock(required=True, validators=[URL_VALIDATOR])),
], label="Link", icon="link"
), label="Link sezione"
)
link i need to insert: http://intranet/example/ the link is without dots and match regular expression 'http\D+' but when i save the page get the default error "Enter a valid URL."
if i add ".com" http://intranet.com/example/, works. i think the default validator is not overrided