From 022b0525f2ddb3c9a0d077bab15992fc293806bb Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sat, 18 Apr 2020 19:17:04 +0200 Subject: [PATCH] Fix #248 --- machines/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/machines/models.py b/machines/models.py index 96a6eb48..55fb8838 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1623,15 +1623,15 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): raise ValidationError( _("You can't create a CNAME record pointing to itself.") ) - HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[A-Z\d-]+(? 63: + HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[a-z\d-]+(? 63: raise ValidationError( - _("The domain name %s is too long (over 63 characters).") % dns + _("The domain name %s is too long (over 63 characters).") % self.name ) - if not HOSTNAME_LABEL_PATTERN.match(dns): + if not HOSTNAME_LABEL_PATTERN.match(self.name): raise ValidationError( - _("The domain name %s contains forbidden characters.") % dns + _("The domain name %s contains forbidden characters.") % self.name ) self.validate_unique() super(Domain, self).clean()