From: Stephen Finucane Date: Sat, 19 Nov 2016 18:38:55 +0000 (+0000) Subject: forms: Tighten validation on BundleForm X-Git-Tag: v2.0.0-rc1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c7c7f3c091380e5d0dd33723f34b980d037019;p=thirdparty%2Fpatchwork.git forms: Tighten validation on BundleForm The 'name' field of 'Bundle' cannot be blank, so update the form to reflect this. Signed-off-by: Stephen Finucane --- diff --git a/patchwork/forms.py b/patchwork/forms.py index 702779ed..54bb02a5 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -65,7 +65,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: