diff mbox

forms: Tighten validation on BundleForm

Message ID 1458913235-26154-1-git-send-email-stephen.finucane@intel.com
State Accepted
Headers show

Commit Message

Stephen Finucane March 25, 2016, 1:40 p.m. UTC
The 'name' field of 'Bundle' cannot be blank, so update the form to
reflect this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
 patchwork/forms.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Finucane Nov. 19, 2016, 6:39 p.m. UTC | #1
On 25 Mar 13:40, Stephen Finucane wrote:
> The 'name' field of 'Bundle' cannot be blank, so update the form to
> reflect this.
> 
> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>

This still applied cleanly. Merged.
diff mbox

Patch

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: