From 62226c26ac1b3631f9ff8bcadb28f2749c144975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 23 Jan 2021 18:48:34 +0100 Subject: [PATCH] Require non-empty circle name when creating a new circle --- snikket_web/admin.py | 1 + snikket_web/templates/admin_circles.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/snikket_web/admin.py b/snikket_web/admin.py index 9b9e843..e4548a7 100644 --- a/snikket_web/admin.py +++ b/snikket_web/admin.py @@ -272,6 +272,7 @@ async def edit_invite(id_: str) -> typing.Union[str, quart.Response]: class CirclePost(flask_wtf.FlaskForm): # type:ignore name = wtforms.StringField( _l("Name"), + validators=[wtforms.validators.InputRequired()], ) action_create = wtforms.SubmitField( diff --git a/snikket_web/templates/admin_circles.html b/snikket_web/templates/admin_circles.html index a6b14a6..5e81e05 100644 --- a/snikket_web/templates/admin_circles.html +++ b/snikket_web/templates/admin_circles.html @@ -41,7 +41,7 @@ {{- create_form.csrf_token -}}

{% trans %}Create circle{% endtrans %}

- {{- create_form.name.label -}} + {{- create_form.name.label(class="required") -}} {{- create_form.name -}}