realms-wiki/realms/modules/auth/local/forms.py

20 lines
669 B
Python
Raw Permalink Normal View History

from __future__ import absolute_import
2014-10-22 00:06:27 +03:00
from flask_wtf import Form
2014-08-30 18:06:12 +03:00
from wtforms import StringField, PasswordField, validators
2014-08-20 18:28:25 +03:00
2014-08-20 18:28:25 +03:00
class RegistrationForm(Form):
username = StringField('Username', [validators.Length(min=4, max=25)])
email = StringField('Email Address', [validators.Length(min=6, max=35)])
password = PasswordField('Password', [
validators.DataRequired(),
validators.EqualTo('confirm', message='Passwords must match')
])
confirm = PasswordField('Repeat Password')
class LoginForm(Form):
2014-08-30 18:06:12 +03:00
email = StringField('Email', [validators.DataRequired()])
password = PasswordField('Password', [validators.DataRequired()])