]> git.lizzy.rs Git - cheatdb.git/blobdiff - app/blueprints/packages/screenshots.py
Fix screenshot form not validating length
[cheatdb.git] / app / blueprints / packages / screenshots.py
index 5aec9ae8f76afdfe00ad29b1fae6388bec031a99..cb21a56500171384298cd886cade34186c2ff6d3 100644 (file)
@@ -29,13 +29,13 @@ from wtforms.validators import *
 
 
 class CreateScreenshotForm(FlaskForm):
-       title      = StringField("Title/Caption", [Optional()])
+       title      = StringField("Title/Caption", [Optional(), Length(-1, 100)])
        fileUpload = FileField("File Upload", [InputRequired()])
        submit     = SubmitField("Save")
 
 
 class EditScreenshotForm(FlaskForm):
-       title    = StringField("Title/Caption", [Optional()])
+       title    = StringField("Title/Caption", [Optional(), Length(-1, 100)])
        approved = BooleanField("Is Approved")
        delete   = BooleanField("Delete")
        submit   = SubmitField("Save")