[PATCH] forms: Tighten validation on BundleForm
Stephen Finucane
stephen.finucane at intel.com
Sat Mar 26 00:40:35 AEDT 2016
The 'name' field of 'Bundle' cannot be blank, so update the form to
reflect this.
Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
patchwork/forms.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/patchwork/forms.py b/patchwork/forms.py
index 628761b..41766c3 100644
--- a/patchwork/forms.py
+++ b/patchwork/forms.py
@@ -63,7 +63,7 @@ class LoginForm(forms.Form):
class BundleForm(forms.ModelForm):
name = forms.RegexField(
- regex=r'^[^/]+$', max_length=50, label=u'Name',
+ regex=r'^[^/]+$', min_length=1, max_length=50, label=u'Name',
error_messages={'invalid': 'Bundle names can\'t contain slashes'})
class Meta:
--
2.0.0
More information about the Patchwork
mailing list