mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-07 07:16:18 -06:00
Limit possible characters in a username heavily to combat abuse
This commit is contained in:
6
forms.py
6
forms.py
@@ -5,7 +5,9 @@ from validators import NoProfanity
|
|||||||
|
|
||||||
|
|
||||||
class RegistrationForm(FlaskForm):
|
class RegistrationForm(FlaskForm):
|
||||||
username = StringField('Username', [validators.Length(min=4, max=25), NoProfanity()])
|
username = StringField('Username', [validators.Length(min=4, max=25),
|
||||||
|
validators.Regexp(r' ^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'),
|
||||||
|
NoProfanity()])
|
||||||
name = StringField('Name', [validators.Length(min=2, max=35), NoProfanity()])
|
name = StringField('Name', [validators.Length(min=2, max=35), NoProfanity()])
|
||||||
password = PasswordField('New Password', [
|
password = PasswordField('New Password', [
|
||||||
validators.DataRequired(),
|
validators.DataRequired(),
|
||||||
@@ -23,7 +25,7 @@ class LoginForm(FlaskForm):
|
|||||||
|
|
||||||
class EditProfileForm(FlaskForm):
|
class EditProfileForm(FlaskForm):
|
||||||
name = RegistrationForm.name
|
name = RegistrationForm.name
|
||||||
about_me = TextAreaField('About Me', [validators.Optional(), NoProfanity()], description='Tell us about yourself',)
|
about_me = TextAreaField('About Me', [validators.Optional(), NoProfanity()], description='Tell us about yourself', )
|
||||||
|
|
||||||
|
|
||||||
class NewPostForm(FlaskForm):
|
class NewPostForm(FlaskForm):
|
||||||
|
|||||||
Reference in New Issue
Block a user