<s> '''<STR_LIT>''' <EOL> from flask . ext . wtf import Form <EOL> from wtforms . fields import HiddenField <EOL> from wtforms . fields import PasswordField <EOL> from wtforms . fields import StringField <EOL> from wtforms . validators import EqualTo <EOL> from wtforms . validators import InputRequired <EOL> from wtforms . validators import Length <EOL> from wtforms . validators import ValidationError <EOL> from markwiki import app <EOL> def is_new_user ( form , field ) : <EOL> if app . user_storage . find_by_name ( field . data ) is not None : <EOL> raise ValidationError ( '<STR_LIT>' ) <EOL> class AddUserForm ( Form ) : <EOL> username = StringField ( '<STR_LIT>' , [ <EOL> InputRequired ( '<STR_LIT>' ) , <EOL> Length ( max = <NUM_LIT> , message = '<STR_LIT>' ) , <EOL> is_new_user <EOL> ] ) <EOL> class LoginForm ( Form ) : <EOL> username = StringField ( '<STR_LIT>' , [ <EOL> InputRequired ( '<STR_LIT>' ) , <EOL> Length ( max = <NUM_LIT> , message = '<STR_LIT>' ) <EOL> ] ) <EOL> password = PasswordField ( '<STR_LIT>' , [ <EOL> InputRequired ( '<STR_LIT>' ) <EOL> ] ) <EOL> next = HiddenField ( ) <EOL> class RegisterForm ( Form ) : <EOL> username = StringField ( '<STR_LIT>' , [ <EOL> InputRequired ( '<STR_LIT>' ) , <EOL> Length ( max = <NUM_LIT> , message = '<STR_LIT>' ) , <EOL> is_new_user <EOL> ] ) <EOL> password = PasswordField ( '<STR_LIT>' , [ <EOL> InputRequired ( '<STR_LIT>' ) , <EOL> EqualTo ( '<STR_LIT>' , message = '<STR_LIT>' ) , <EOL> Length ( min = <NUM_LIT:8> , message = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) ) , <EOL> ] ) <EOL> confirm = PasswordField ( '<STR_LIT>' ) </s>
