1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Reconfig to create nat routed network without subnet

This commit is contained in:
catborise 2019-11-07 16:49:40 +03:00
parent 78ec7ac746
commit 8bc316355d
3 changed files with 5 additions and 7 deletions

View file

@ -7,7 +7,7 @@ class AddNetPool(forms.Form):
name = forms.CharField(error_messages={'required': _('No pool name has been entered')},
max_length=20)
subnet = forms.CharField(error_messages={'required': _('No subnet has been entered')},
max_length=20)
max_length=20, required=False)
forward = forms.CharField(max_length=100)
dhcp4 = forms.BooleanField(required=False)
fixed = forms.BooleanField(required=False)
@ -25,7 +25,7 @@ class AddNetPool(forms.Form):
def clean_subnet(self):
subnet = self.cleaned_data['subnet']
have_symbol = re.match('^[0-9./]+$', subnet)
have_symbol = re.match('^[0-9./]+$', subnet if subnet else ".")
if not have_symbol:
raise forms.ValidationError(_('The pool subnet must not contain any special characters'))
elif len(subnet) > 20: