mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 14:37:36 +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):
|
class CreateScreenshotForm(FlaskForm):
|
||||||
title = StringField("Title/Caption", [Optional()])
|
title = StringField("Title/Caption", [Optional(), Length(-1, 100)])
|
||||||
fileUpload = FileField("File Upload", [InputRequired()])
|
fileUpload = FileField("File Upload", [InputRequired()])
|
||||||
submit = SubmitField("Save")
|
submit = SubmitField("Save")
|
||||||
|
|
||||||
|
|
||||||
class EditScreenshotForm(FlaskForm):
|
class EditScreenshotForm(FlaskForm):
|
||||||
title = StringField("Title/Caption", [Optional()])
|
title = StringField("Title/Caption", [Optional(), Length(-1, 100)])
|
||||||
approved = BooleanField("Is Approved")
|
approved = BooleanField("Is Approved")
|
||||||
delete = BooleanField("Delete")
|
delete = BooleanField("Delete")
|
||||||
submit = SubmitField("Save")
|
submit = SubmitField("Save")
|
||||||
|
@ -226,10 +226,11 @@ def postReleaseCheckUpdate(self, release, path):
|
|||||||
return tree
|
return tree
|
||||||
|
|
||||||
except MinetestCheckError as err:
|
except MinetestCheckError as err:
|
||||||
|
db.session.rollback()
|
||||||
|
|
||||||
if "Fails validation" not in release.title:
|
if "Fails validation" not in release.title:
|
||||||
release.title += " (Fails validation)"
|
release.title += " (Fails validation)"
|
||||||
|
|
||||||
db.session.rollback()
|
|
||||||
release.task_id = self.request.id
|
release.task_id = self.request.id
|
||||||
release.approved = False
|
release.approved = False
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user