Check tos accepted in registration form

This commit is contained in:
Patrick Jentsch 2024-11-18 11:03:29 +01:00
parent fc8b11fa66
commit 2c43333c94

View File

@ -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):