-
-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Description
When adding Optional() in the validators list, all other validators seem to disqualify.
For example:
class ModifyLinkForm(FlaskForm):
description = TextAreaField('Description', validators=[
Optional()
, Length(max=256)
, Regexp(r"^[a-zA-Z0-9\s.,!?\"'()\-\:_]+$", message="Invalid characters in description.")
])
Will ignore the Length, and the Regex validators.
I need to accept empty string and None, but as soon as there is data, I need validation.
Environment:
- Python version: 3.9.13
- Flask-WTF version: 1.2.1
- Flask version: 3.03
Metadata
Metadata
Assignees
Labels
No labels