mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
User names cannot contain @.
This commit is contained in:
parent
1af3ee8649
commit
bc2211a540
1 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,8 @@ class RegistrationForm(FlaskForm):
|
||||||
raise ValidationError(_l('An account with this email address already exists.'))
|
raise ValidationError(_l('An account with this email address already exists.'))
|
||||||
|
|
||||||
def validate_user_name(self, user_name):
|
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()
|
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 is not None:
|
||||||
if user.deleted:
|
if user.deleted:
|
||||||
|
|
Loading…
Reference in a new issue