mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-12 18:43:48 +01:00
Disallow spaces in usernames
This commit is contained in:
parent
c11e5c1f99
commit
df8ef542dd
@ -102,7 +102,7 @@ def logout():
|
|||||||
class RegisterForm(FlaskForm):
|
class RegisterForm(FlaskForm):
|
||||||
display_name = StringField("Display Name", [Optional(), Length(1, 20)], filters=[lambda x: nonEmptyOrNone(x)])
|
display_name = StringField("Display Name", [Optional(), Length(1, 20)], filters=[lambda x: nonEmptyOrNone(x)])
|
||||||
username = StringField("Username", [InputRequired(),
|
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()])
|
email = StringField("Email", [InputRequired(), Email()])
|
||||||
password = PasswordField("Password", [InputRequired(), Length(6, 100)])
|
password = PasswordField("Password", [InputRequired(), Length(6, 100)])
|
||||||
agree = BooleanField("I agree", [Required()])
|
agree = BooleanField("I agree", [Required()])
|
||||||
|
@ -13,7 +13,7 @@ Register
|
|||||||
<form action="" method="POST" class="form card-body" role="form">
|
<form action="" method="POST" class="form card-body" role="form">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
|
|
||||||
{{ render_field(form.username, pattern="[a-zA-Z0-9._ -]+", title=_("Only a-zA-Z0-9._ allowed"),
|
{{ render_field(form.username, pattern="[a-zA-Z0-9._-]+", title=_("Only a-zA-Z0-9._ allowed"),
|
||||||
hint=_("Only alphanumeric characters, periods, underscores, and minuses are allowed (a-zA-Z0-9._)")) }}
|
hint=_("Only alphanumeric characters, periods, underscores, and minuses are allowed (a-zA-Z0-9._)")) }}
|
||||||
|
|
||||||
{{ render_field(form.display_name,
|
{{ render_field(form.display_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user