mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Fix screenshot form not validating length
This commit is contained in:
parent
e85d1755f0
commit
934d581737
@ -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")
|
||||
|
@ -226,10 +226,11 @@ def postReleaseCheckUpdate(self, release, path):
|
||||
return tree
|
||||
|
||||
except MinetestCheckError as err:
|
||||
db.session.rollback()
|
||||
|
||||
if "Fails validation" not in release.title:
|
||||
release.title += " (Fails validation)"
|
||||
|
||||
db.session.rollback()
|
||||
release.task_id = self.request.id
|
||||
release.approved = False
|
||||
db.session.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user