Disallow spaces in usernames

This commit is contained in:
rubenwardy
2021-03-02 22:36:21 +00:00
parent c11e5c1f99
commit df8ef542dd
2 changed files with 2 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ def logout():
class RegisterForm(FlaskForm):
display_name = StringField("Display Name", [Optional(), Length(1, 20)], filters=[lambda x: nonEmptyOrNone(x)])
username = StringField("Username", [InputRequired(),
Regexp("^[a-zA-Z0-9._ -]+$", message="Only a-zA-Z0-9._ allowed")])
Regexp("^[a-zA-Z0-9._-]+$", message="Only a-zA-Z0-9._ allowed")])
email = StringField("Email", [InputRequired(), Email()])
password = PasswordField("Password", [InputRequired(), Length(6, 100)])
agree = BooleanField("I agree", [Required()])