From 2c43333c947c6d24f6fa25687cc4dc62fd0ed26b Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 18 Nov 2024 11:03:29 +0100 Subject: [PATCH] Check tos accepted in registration form --- app/blueprints/auth/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/blueprints/auth/forms.py b/app/blueprints/auth/forms.py index a6ce0017..a3dd14d1 100644 --- a/app/blueprints/auth/forms.py +++ b/app/blueprints/auth/forms.py @@ -60,7 +60,11 @@ class RegistrationForm(FlaskForm): def validate_username(self, field): if User.query.filter_by(username=field.data).first(): - raise ValidationError('Username already in use') + raise ValidationError('Username already registered') + + def validate_terms_of_use_accepted(self, field): + if not field.data: + raise ValidationError('Terms of Use not accepted') class LoginForm(FlaskForm):