forked from alexeykuz-sys/hackathon-doubleShamrocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
43 lines (34 loc) · 1.87 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Length, EqualTo
class RegisterForm(FlaskForm):
username = StringField('Username',
validators=[DataRequired(), Length(min=3, max=15)])
password = PasswordField('Password',
validators=[DataRequired(),
Length(min=3, max=15)])
confirm_password = PasswordField('Confirm Password',
validators=[DataRequired(),
EqualTo('password')])
submit = SubmitField('Register')
class LoginForm(FlaskForm):
username = StringField('Username',
validators=[DataRequired(), Length(min=3, max=15)])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Login')
class ChangeUsernameForm(FlaskForm):
new_username = StringField('New Username',
validators=[DataRequired(),
Length(min=3, max=15)])
submit = SubmitField('Change Username')
class ChangePasswordForm(FlaskForm):
old_password = PasswordField('Current Password',
validators=[DataRequired(),
Length(min=3, max=15)])
new_password = PasswordField('New Password', validators=[DataRequired(),
Length(min=3,
max=15)])
confirm_new_password = PasswordField('Confirm New Password',
validators=[DataRequired(),
Length(min=3, max=15)])
submit = SubmitField('Change Password')