1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00
This commit is contained in:
Anatoliy Guskov 2015-03-11 21:31:08 +02:00
parent da6a2d7e29
commit e9236f22a2

View file

@ -31,9 +31,10 @@ class AddStgPool(forms.Form):
storage_type = self.cleaned_data['stg_type'] storage_type = self.cleaned_data['stg_type']
target = self.cleaned_data['target'] target = self.cleaned_data['target']
have_symbol = re.match('^[a-zA-Z0-9/]+$', target) have_symbol = re.match('^[a-zA-Z0-9/]+$', target)
if not have_symbol: if storage_type == 'dir' or storage_type == 'netfs':
raise forms.ValidationError(_('The target must not contain any special characters')) if not have_symbol:
if storage_type == 'dir': raise forms.ValidationError(_('The target must not contain any special characters'))
if storage_type == 'dir' or storage_type == 'netfs':
if not target: if not target:
raise forms.ValidationError(_('No path has been entered')) raise forms.ValidationError(_('No path has been entered'))
return target return target