Bug #437 - adds required validator to slug field for media edit'
authorCaleb Forbes Davis V <caldavis@gmail.com>
Thu, 7 Jul 2011 16:11:03 +0000 (11:11 -0500)
committerCaleb Forbes Davis V <caldavis@gmail.com>
Thu, 7 Jul 2011 16:11:03 +0000 (11:11 -0500)
otherwise we get a 404 because we navigate to blank slug

mediagoblin/edit/forms.py

index d5e7f0a99821670799c9445f76d83e3d0ea4ba66..0ed52af11ea4a24b6265b735197fdc9006d2d454 100644 (file)
@@ -23,7 +23,8 @@ class EditForm(wtforms.Form):
         'Title',
         [wtforms.validators.Length(min=0, max=500)])
     slug = wtforms.TextField(
-        'Slug')
+        'Slug',
+        [wtforms.validators.Required(message="The slug can't be empty")])
     description = wtforms.TextAreaField('Description of this work')
 
 class EditProfileForm(wtforms.Form):