Rename and rework profile packege (new name settings)

This commit is contained in:
Patrick Jentsch
2020-10-23 13:52:01 +02:00
parent 1092033a19
commit 700e11ec23
15 changed files with 316 additions and 288 deletions

View File

@ -1,3 +1,4 @@
from flask import current_app
from ..models import User
from flask_wtf import FlaskForm
from wtforms import (BooleanField, PasswordField, StringField, SubmitField,
@ -17,9 +18,9 @@ class RegistrationForm(FlaskForm):
username = StringField(
'Username',
validators=[DataRequired(), Length(1, 64),
Regexp('^[A-Za-z][A-Za-z0-9_.]*$', 0,
'Usernames must have only letters, numbers, dots '
'or underscores')]
Regexp(current_app.config['ALLOWED_USERNAME_REGEX'],
message='Usernames must have only letters, numbers,'
' dots or underscores')]
)
password = PasswordField(
'Password',