write data check

This commit is contained in:
2024-06-22 04:00:38 +00:00
parent 77649bcec2
commit ae5fda3488
4 changed files with 69 additions and 13 deletions

12
UI/datacheck.py Normal file
View 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.')
])