write data check
This commit is contained in:
12
UI/datacheck.py
Normal file
12
UI/datacheck.py
Normal file
@ -0,0 +1,12 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, PasswordField
|
||||
from wtforms.validators import InputRequired, Length, Regexp
|
||||
class LoginForm(FlaskForm):
|
||||
username = StringField('Username', validators=[
|
||||
InputRequired(message='Username is required.'),
|
||||
Regexp(r'^[a-zA-Z][a-zA-Z0-9_]{0,19}$', message='Invalid username format.')
|
||||
])
|
||||
password = PasswordField('Password', validators=[
|
||||
InputRequired(message='Password is required.'),
|
||||
Length(min=1, max=30, message='Password must be between 1 and 30 characters long.')
|
||||
])
|
Reference in New Issue
Block a user