mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Fix #248
This commit is contained in:
parent
614538eefe
commit
d1de4e365c
1 changed files with 6 additions and 6 deletions
|
@ -1623,15 +1623,15 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_("You can't create a CNAME record pointing to itself.")
|
_("You can't create a CNAME record pointing to itself.")
|
||||||
)
|
)
|
||||||
HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[A-Z\d-]+(?<!-)$", re.IGNORECASE)
|
HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[a-z\d-]+(?<!-)$")
|
||||||
dns = self.name.lower()
|
self.name = self.name.lower()
|
||||||
if len(dns) > 63:
|
if len(self.name) > 63:
|
||||||
raise ValidationError(
|
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(
|
raise ValidationError(
|
||||||
_("The domain name %s contains forbidden characters.") % dns
|
_("The domain name %s contains forbidden characters.") % self.name
|
||||||
)
|
)
|
||||||
self.validate_unique()
|
self.validate_unique()
|
||||||
super(Domain, self).clean()
|
super(Domain, self).clean()
|
||||||
|
|
Loading…
Reference in a new issue