mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Add username validation to signup page
This commit is contained in:
parent
3ed73c4145
commit
77dcb85912
@ -100,7 +100,8 @@ def logout():
|
||||
|
||||
|
||||
class RegisterForm(FlaskForm):
|
||||
username = StringField("Username", [InputRequired()])
|
||||
username = StringField("Username", [InputRequired(),
|
||||
Regexp("^[a-zA-Z0-9._ -]+$", message="Only a-zA-Z0-9._ allowed")])
|
||||
email = StringField("Email", [InputRequired(), Email()])
|
||||
password = PasswordField("Password", [InputRequired(), Length(6, 100)])
|
||||
submit = SubmitField("Register")
|
||||
|
@ -92,22 +92,5 @@ Create Account from Forums User
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# <div class="col-sm-4">#}
|
||||
{# <div class="card">#}
|
||||
{# <div class="card-header">#}
|
||||
{# Email/password sign up#}
|
||||
{# </div>#}
|
||||
{##}
|
||||
{# <div class="card-body">#}
|
||||
{# <p>#}
|
||||
{# If you have a forum account, please use one of the other two#}
|
||||
{# options.#}
|
||||
{# </p>#}
|
||||
{##}
|
||||
{# <a class="btn btn-primary" href="{{ url_for('users.register') }}">Register</a>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -7,13 +7,13 @@ Register
|
||||
{% block content %}
|
||||
{% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card w-50 text-left" style="margin: 2em auto;">
|
||||
<h2 class="card-header">{{ _("Register") }}</h2>
|
||||
|
||||
<form action="" method="POST" class="form card-body" role="form">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
{{ render_field(form.username) }}
|
||||
{{ render_field(form.username, pattern="[a-zA-Z0-9._ -]+", title="Only a-zA-Z0-9._ allowed") }}
|
||||
{{ render_field(form.email) }}
|
||||
{{ render_field(form.password) }}
|
||||
|
||||
|
@ -33,7 +33,6 @@ gitdb==4.0.5
|
||||
GitHub-Flask==3.2.0
|
||||
GitPython==3.1.12
|
||||
gunicorn==20.0.4
|
||||
idna==3.1
|
||||
importlib-metadata==3.4.0
|
||||
iniconfig==1.1.1
|
||||
itsdangerous==1.1.0
|
||||
|
@ -6,4 +6,4 @@
|
||||
# docker-compose directly: docker-compose up --build
|
||||
#
|
||||
|
||||
sudo docker-compose up --build -d --scale worker=2
|
||||
docker-compose up --build -d --scale worker=2
|
||||
|
Loading…
Reference in New Issue
Block a user