mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-08 18:09:13 -06:00
make static based methods static
This commit is contained in:
@@ -28,12 +28,14 @@ class RegistrationForm(FlaskForm):
|
||||
)
|
||||
submit = SubmitField("Register")
|
||||
|
||||
def validate_username(self, username):
|
||||
@staticmethod
|
||||
def validate_username(username):
|
||||
user = User.query.filter_by(username=username.data).first()
|
||||
if user is not None:
|
||||
raise ValidationError("That username is not available.")
|
||||
|
||||
def validate_email(self, email):
|
||||
@staticmethod
|
||||
def validate_email(email):
|
||||
user = User.query.filter_by(email=email.data).first()
|
||||
if user is not None:
|
||||
raise ValidationError("That email address is not available.")
|
||||
|
||||
Reference in New Issue
Block a user