Fix descriptions being required in warning and tag editors

This commit is contained in:
rubenwardy 2020-07-17 22:29:02 +01:00
parent 2a7318eca2
commit e2a9ea91cf
2 changed files with 2 additions and 2 deletions

@ -34,7 +34,7 @@ def tag_list():
class TagForm(FlaskForm): class TagForm(FlaskForm):
title = StringField("Title", [InputRequired(), Length(3,100)]) title = StringField("Title", [InputRequired(), Length(3,100)])
description = TextAreaField("Description", [InputRequired(), Length(0, 500)]) description = TextAreaField("Description", [Optional(), Length(0, 500)])
name = StringField("Name", [Optional(), Length(1, 20), Regexp("^[a-z0-9_]", 0, "Lower case letters (a-z), digits (0-9), and underscores (_) only")]) name = StringField("Name", [Optional(), Length(1, 20), Regexp("^[a-z0-9_]", 0, "Lower case letters (a-z), digits (0-9), and underscores (_) only")])
submit = SubmitField("Save") submit = SubmitField("Save")

@ -31,8 +31,8 @@ def warning_list():
class WarningForm(FlaskForm): class WarningForm(FlaskForm):
title = StringField("Title", [InputRequired(), Length(3,100)]) title = StringField("Title", [InputRequired(), Length(3,100)])
description = TextAreaField("Description", [Optional(), Length(0, 500)])
name = StringField("Name", [Optional(), Length(1, 20), Regexp("^[a-z0-9_]", 0, "Lower case letters (a-z), digits (0-9), and underscores (_) only")]) name = StringField("Name", [Optional(), Length(1, 20), Regexp("^[a-z0-9_]", 0, "Lower case letters (a-z), digits (0-9), and underscores (_) only")])
description = TextAreaField("Description", [InputRequired(), Length(0, 500)])
submit = SubmitField("Save") submit = SubmitField("Save")
@bp.route("/admin/warnings/new/", methods=["GET", "POST"]) @bp.route("/admin/warnings/new/", methods=["GET", "POST"])