Update admin user settings

This commit is contained in:
Patrick Jentsch
2023-03-29 14:32:35 +02:00
parent 9b2353105e
commit e4a8ad911f
16 changed files with 362 additions and 297 deletions

View File

@ -1,8 +1,5 @@
from flask import Blueprint
USERNAME_REGEX = '^[A-Za-zÄÖÜäöüß0-9_.]*$'
bp = Blueprint('auth', __name__)
from . import routes

View File

@ -8,7 +8,6 @@ from wtforms import (
from wtforms.validators import InputRequired, Email, EqualTo, Length, Regexp
from app.forms import NopaqueForm
from app.models import User
from . import USERNAME_REGEX
class RegistrationForm(NopaqueForm):
@ -22,7 +21,7 @@ class RegistrationForm(NopaqueForm):
InputRequired(),
Length(max=64),
Regexp(
USERNAME_REGEX,
User.username_pattern,
message=(
'Usernames must have only letters, numbers, dots or '
'underscores'