mirror of
https://github.com/wizarrrr/wizarr.git
synced 2026-06-11 23:34:47 -04:00
- 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>
32 lines
973 B
Python
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."),
|
|
],
|
|
)
|