optional rdns

This commit is contained in:
deflax 2018-03-16 01:41:11 +02:00
parent 7d8d660de1
commit 9684c409cb

View file

@ -28,7 +28,7 @@ class Addr2PoolForm(FlaskForm):
region_choices = [(1, 'Plovdiv, Bulgaria')]
region = SelectField('Region', choices=region_choices, coerce=int)
ip = StringField('IP Address:', [validators.DataRequired(), validators.Regexp(message='172.16.0.1', regex='^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')])
rdns = StringField('Reverse DNS:', [validators.Regexp(message='must be fqdn', regex='^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$')])
rdns = StringField('Reverse DNS:', [validators.Optional(), validators.Regexp(message='must be fqdn', regex='^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$')])
reserved = BooleanField('Reserved:')
submit = SubmitField('Add IP')