Fix regex for IPAddress.dns_name (but see #3106)

This commit is contained in:
Jeremy Stretch
2019-04-25 14:49:52 -04:00
parent 595a7fe950
commit f8447989f2
3 changed files with 16 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ from django.core.validators import RegexValidator
DNSValidator = RegexValidator(
regex='^[a-z]+$',
regex='^[0-9A-Za-z.-]+$',
message='Only alphanumeric characters, hyphens, and periods are allowed in DNS names',
code='invalid'
)