From eda0a390fa36b798fb298a215b027f273c03da8f Mon Sep 17 00:00:00 2001 From: Retspen Date: Tue, 21 Apr 2015 15:58:56 +0300 Subject: [PATCH] Fixed create net alias --- interfaces/forms.py | 2 +- networks/forms.py | 4 ++-- networks/templates/create_net_block.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/forms.py b/interfaces/forms.py index cebd8a9..e7c22bf 100644 --- a/interfaces/forms.py +++ b/interfaces/forms.py @@ -65,7 +65,7 @@ class AddInterface(forms.Form): def clean_netdev(self): netdev = self.cleaned_data['netdev'] - have_symbol = re.match('^[a-z0-9.]+$', netdev) + have_symbol = re.match('^[a-z0-9.:]+$', netdev) if not have_symbol: raise forms.ValidationError(_('The interface must not contain any special characters')) elif len(netdev) > 10: diff --git a/networks/forms.py b/networks/forms.py index 3d44433..fc94358 100644 --- a/networks/forms.py +++ b/networks/forms.py @@ -16,7 +16,7 @@ class AddNetPool(forms.Form): def clean_name(self): name = self.cleaned_data['name'] - have_symbol = re.match('^[a-zA-Z0-9._-]+$', name) + have_symbol = re.match('^[a-zA-Z0-9\.\_\-]+$', name) if not have_symbol: raise forms.ValidationError(_('The pool name must not contain any special characters')) elif len(name) > 20: @@ -35,7 +35,7 @@ class AddNetPool(forms.Form): def clean_bridge_name(self): bridge_name = self.cleaned_data['bridge_name'] if self.cleaned_data['forward'] == 'bridge': - have_symbol = re.match('^[a-zA-Z0-9._-]+$', bridge_name) + have_symbol = re.match('^[a-zA-Z0-9\.\_\:\-]+$', bridge_name) if not have_symbol: raise forms.ValidationError(_('The pool bridge name must not contain any special characters')) elif len(bridge_name) > 20: diff --git a/networks/templates/create_net_block.html b/networks/templates/create_net_block.html index 0ab42b4..166dc23 100644 --- a/networks/templates/create_net_block.html +++ b/networks/templates/create_net_block.html @@ -52,7 +52,7 @@
- +