From e2a9ea91cfae79dded1f223bd288af40bd657863 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 17 Jul 2020 22:29:02 +0100 Subject: [PATCH] Fix descriptions being required in warning and tag editors --- app/blueprints/admin/tagseditor.py | 2 +- app/blueprints/admin/warningseditor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/blueprints/admin/tagseditor.py b/app/blueprints/admin/tagseditor.py index 3d351ee2..d9cc9135 100644 --- a/app/blueprints/admin/tagseditor.py +++ b/app/blueprints/admin/tagseditor.py @@ -34,7 +34,7 @@ def tag_list(): class TagForm(FlaskForm): 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")]) submit = SubmitField("Save") diff --git a/app/blueprints/admin/warningseditor.py b/app/blueprints/admin/warningseditor.py index 418d052d..f4c2fa4d 100644 --- a/app/blueprints/admin/warningseditor.py +++ b/app/blueprints/admin/warningseditor.py @@ -31,8 +31,8 @@ def warning_list(): class WarningForm(FlaskForm): 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")]) - description = TextAreaField("Description", [InputRequired(), Length(0, 500)]) submit = SubmitField("Save") @bp.route("/admin/warnings/new/", methods=["GET", "POST"])