Files
wizarr/app/forms/join.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

38 lines
1.1 KiB
Python

from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired, Email, EqualTo, Length, Regexp
class JoinForm(FlaskForm):
username = StringField(
"Username",
validators=[DataRequired()],
)
email = StringField(
"Email",
validators=[DataRequired(), Email()],
)
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_password = PasswordField(
"Confirm password",
validators=[
DataRequired(),
EqualTo("password", message="Passwords must match."),
],
)
code = StringField(
"Invite Code",
validators=[DataRequired(), Length(min=6, max=10)],
render_kw={"minlength": 6, "maxlength": 10},
)