]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
forms: Tighten validation on BundleForm
authorStephen Finucane <stephen@that.guru>
Sat, 19 Nov 2016 18:38:55 +0000 (18:38 +0000)
committerStephen Finucane <stephen@that.guru>
Sat, 19 Nov 2016 18:38:55 +0000 (18:38 +0000)
The 'name' field of 'Bundle' cannot be blank, so update the form to
reflect this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/forms.py

index 702779ed9f7cdb63bcdc9a0332e6691d49cb6484..54bb02a5b1476a63286a29666509525db5d43ecd 100644 (file)
@@ -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: