From e9236f22a20a19cb903f5f667a70faaf554ee8b5 Mon Sep 17 00:00:00 2001 From: Anatoliy Guskov Date: Wed, 11 Mar 2015 21:31:08 +0200 Subject: [PATCH] Fix rdb --- storages/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/storages/forms.py b/storages/forms.py index e2114ee..a4a34bf 100644 --- a/storages/forms.py +++ b/storages/forms.py @@ -31,9 +31,10 @@ class AddStgPool(forms.Form): storage_type = self.cleaned_data['stg_type'] target = self.cleaned_data['target'] have_symbol = re.match('^[a-zA-Z0-9/]+$', target) - if not have_symbol: - raise forms.ValidationError(_('The target must not contain any special characters')) - if storage_type == 'dir': + if storage_type == 'dir' or storage_type == 'netfs': + if not have_symbol: + raise forms.ValidationError(_('The target must not contain any special characters')) + if storage_type == 'dir' or storage_type == 'netfs': if not target: raise forms.ValidationError(_('No path has been entered')) return target