domainnameoption: better error message
This commit is contained in:
parent
8b4ceddb81
commit
d2a7c2b31c
1 changed files with 2 additions and 4 deletions
|
@ -74,12 +74,10 @@ class DomainnameOption(StrOption):
|
||||||
else:
|
else:
|
||||||
min_time = 1
|
min_time = 1
|
||||||
regexp = r'((?!-)[a-z0-9-]{{{1},{0}}}\.){{{1},}}[a-z0-9-]{{1,{0}}}'.format(self._get_len(type), min_time)
|
regexp = r'((?!-)[a-z0-9-]{{{1},{0}}}\.){{{1},}}[a-z0-9-]{{1,{0}}}'.format(self._get_len(type), min_time)
|
||||||
msg = _('only lowercase, number, "-" and "." characters are allowed')
|
|
||||||
msg_warning = _('only lowercase, number, "-" and "." characters are recommanded')
|
|
||||||
else:
|
else:
|
||||||
regexp = r'((?!-)[a-z0-9-]{{1,{0}}})'.format(self._get_len(type))
|
regexp = r'((?!-)[a-z0-9-]{{1,{0}}})'.format(self._get_len(type))
|
||||||
msg = _('only lowercase, number and "-" characters are allowed')
|
msg = _('must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are allowed')
|
||||||
msg_warning = _('only lowercase, number and "-" characters are recommanded')
|
msg_warning = _('must start with lowercase characters followed by lowercase characters, number, "-" and "." characters are recommanded')
|
||||||
if allow_ip:
|
if allow_ip:
|
||||||
msg = _('could be a IP, otherwise {}').format(msg)
|
msg = _('could be a IP, otherwise {}').format(msg)
|
||||||
msg_warning = _('could be a IP, otherwise {}').format(msg_warning)
|
msg_warning = _('could be a IP, otherwise {}').format(msg_warning)
|
||||||
|
|
Loading…
Reference in a new issue