|
@ -8,10 +8,6 @@ from wtforms.validators import Email, EqualTo, Length, ValidationError |
|
|
class RegisterForm(FlaskForm): |
|
|
class RegisterForm(FlaskForm): |
|
|
"""Register for distribusi-verse form class""" |
|
|
"""Register for distribusi-verse form class""" |
|
|
|
|
|
|
|
|
def hremail(form, field): |
|
|
|
|
|
if not field.data.endswith("@hr.nl"): |
|
|
|
|
|
raise ValidationError("Only HRO accounts are allowed.") |
|
|
|
|
|
|
|
|
|
|
|
username = StringField( |
|
|
username = StringField( |
|
|
"Username:", |
|
|
"Username:", |
|
|
validators=[validators.InputRequired(), Length(3, 150)], |
|
|
validators=[validators.InputRequired(), Length(3, 150)], |
|
@ -22,8 +18,7 @@ class RegisterForm(FlaskForm): |
|
|
validators=[ |
|
|
validators=[ |
|
|
validators.InputRequired(), |
|
|
validators.InputRequired(), |
|
|
Email(), |
|
|
Email(), |
|
|
Length(6, 64), |
|
|
Length(6, 128), |
|
|
hremail, |
|
|
|
|
|
], |
|
|
], |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|