mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
Allow hyphens in hostname and domainname. Fixes #275.
This commit is contained in:
parent
86d3d714fc
commit
45fff7057b
@ -68,7 +68,7 @@ class ConfigurationForm(forms.Form):
|
|||||||
'start with an alphabet and must not be greater than 63 '
|
'start with an alphabet and must not be greater than 63 '
|
||||||
'characters in length.'),
|
'characters in length.'),
|
||||||
validators=[
|
validators=[
|
||||||
validators.RegexValidator(r'^[a-zA-Z][a-zA-Z0-9]{,62}$',
|
validators.RegexValidator(r'^[a-zA-Z][-a-zA-Z0-9]{,61}[a-zA-Z0-9]$',
|
||||||
ugettext_lazy('Invalid hostname'))])
|
ugettext_lazy('Invalid hostname'))])
|
||||||
|
|
||||||
domainname = TrimmedCharField(
|
domainname = TrimmedCharField(
|
||||||
@ -79,7 +79,7 @@ class ConfigurationForm(forms.Form):
|
|||||||
'of alphanumeric words separated by dots.'),
|
'of alphanumeric words separated by dots.'),
|
||||||
required=False,
|
required=False,
|
||||||
validators=[
|
validators=[
|
||||||
validators.RegexValidator(r'^[a-zA-Z][a-zA-Z0-9.]*$',
|
validators.RegexValidator(r'^[a-zA-Z][-a-zA-Z0-9.]*[a-zA-Z0-9]$',
|
||||||
ugettext_lazy('Invalid domain name'))])
|
ugettext_lazy('Invalid domain name'))])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user