Files
wizarr/app/forms/setup.py
Matthieu B 7b8f64af7d Fix SQLAlchemy model constructors to accept keyword arguments
- Added __init__ constructors to all SQLAlchemy models
- Fixed pyright 'No parameter named' errors across the codebase
- Fixed various ruff linting issues (SIM108, E741, E402, SIM102, B904, SIM105)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 13:52:15 +02:00

32 lines
973 B
Python

from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired, EqualTo, Length, Regexp
class AdminAccountForm(FlaskForm):
username = StringField(
"Username",
validators=[
DataRequired(),
Length(min=3, max=15, message="Username must be 3 to 15 characters."),
],
)
password = PasswordField(
"Password",
validators=[
DataRequired(),
Length(min=8, message="Password must be at least 8 characters."),
Regexp(
r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$",
message="Password must contain at least one uppercase letter, one lowercase letter, and one number.",
),
],
)
confirm = PasswordField(
"Confirm password",
validators=[
DataRequired(),
EqualTo("password", message="Passwords must match."),
],
)