You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
877 B
33 lines
877 B
3 years ago
|
"""Register form to make a new user."""
|
||
|
from wtforms import (
|
||
|
StringField,
|
||
|
SubmitField,
|
||
|
PasswordField,
|
||
|
)
|
||
|
|
||
|
from wtforms import validators
|
||
|
from wtforms.validators import Length, Email, EqualTo
|
||
|
from flask_wtf import FlaskForm
|
||
|
|
||
|
|
||
|
class RegisterForm(FlaskForm):
|
||
|
"""Register for distribusi-verse form class"""
|
||
|
|
||
|
email = StringField(
|
||
|
"Email address:",
|
||
|
validators=[validators.InputRequired(), Email(), Length(6, 64)],
|
||
|
)
|
||
|
password = PasswordField(
|
||
|
"New password:",
|
||
|
validators=[validators.InputRequired(), Length(12, 72)],
|
||
|
)
|
||
|
confirmpassword = PasswordField(
|
||
|
"Confirm your password:",
|
||
|
validators=[
|
||
|
validators.InputRequired(),
|
||
|
Length(12, 72),
|
||
|
EqualTo("password", message="Passwords must match !"),
|
||
|
],
|
||
|
)
|
||
|
submit = SubmitField("Register to Distribusi-verse")
|