]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix descriptions being required in warning and tag editors
authorrubenwardy <rw@rubenwardy.com>
Fri, 17 Jul 2020 21:29:02 +0000 (22:29 +0100)
committerrubenwardy <rw@rubenwardy.com>
Fri, 17 Jul 2020 21:29:02 +0000 (22:29 +0100)
app/blueprints/admin/tagseditor.py
app/blueprints/admin/warningseditor.py

index 3d351ee21fb5209d81d9e9f20e4b7270406344a2..d9cc9135d48fe1b47b23266cf4fd167fcc2c9c95 100644 (file)
@@ -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")
 
index 418d052daefe9d2af01557bb0ca0731ab02bc31c..f4c2fa4d86cc9af867217c65edb3be8f7e70c161 100644 (file)
@@ -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"])