From bc2211a5406a311dad7d3e4809f5483da6b6cbb2 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:18:21 +1300 Subject: [PATCH] User names cannot contain @. --- app/auth/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/auth/forms.py b/app/auth/forms.py index fce3f38f..9c660a7e 100644 --- a/app/auth/forms.py +++ b/app/auth/forms.py @@ -32,6 +32,8 @@ class RegistrationForm(FlaskForm): raise ValidationError(_l('An account with this email address already exists.')) def validate_user_name(self, user_name): + if '@' in user_name.data: + raise ValidationError(_l('User names cannot contain @.')) user = User.query.filter(func.lower(User.user_name) == func.lower(user_name.data.strip())).filter_by(ap_id=None).first() if user is not None: if user.deleted: