Skip to content

Commit

Permalink
Merge pull request #197 from rackerlabs/issue-194-allow-hyphens-in-dn…
Browse files Browse the repository at this point in the history
…s-domains

Updated models.py to allow hypens in DNS domain targets
  • Loading branch information
derpadoo committed Apr 30, 2020
2 parents fbb3e64 + 7b3e6ba commit 9b82c9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion master/django_scantron/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.26"
__version__ = "1.27"
10 changes: 5 additions & 5 deletions master/django_scantron/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.contrib.auth.models import User # noqa
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, RegexValidator
from django.core.validators import RegexValidator
from django.db.models.signals import post_save
from django.dispatch import receiver

Expand Down Expand Up @@ -94,8 +94,8 @@ class Site(models.Model):
max_length=1_048_576, # 2^20 = 1048576
validators=[
RegexValidator(
regex="^[a-zA-Z0-9/\.\: ]*$", # Characters to support IPv4, IPv6, and FQDNs only. Space delimited.
message="Targets can only contain alphanumeric characters, /, ., :, and spaces",
regex="^[a-zA-Z0-9/\.\:\- ]*$", # Characters to support IPv4, IPv6, and FQDNs only. Space delimited.
message="Targets can only contain alphanumeric characters, /, ., :, -, and spaces",
)
],
verbose_name="Targets",
Expand All @@ -106,8 +106,8 @@ class Site(models.Model):
max_length=1_048_576, # 2^20 = 1048576
validators=[
RegexValidator(
regex="^[a-zA-Z0-9/\.\: ]*$", # Characters to support IPv4, IPv6, and FQDNs only. Space delimited.
message="Excluded targets can only contain alphanumeric characters, /, ., :, and spaces",
regex="^[a-zA-Z0-9/\.\:\- ]*$", # Characters to support IPv4, IPv6, and FQDNs only. Space delimited.
message="Excluded targets can only contain alphanumeric characters, /, ., :, -, and spaces",
)
],
verbose_name="Excluded targets",
Expand Down

0 comments on commit 9b82c9f

Please sign in to comment.