From 6fd682368856f9760463160b92fb45e11e5b4fb0 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 25 May 2023 15:20:07 -0400 Subject: [PATCH 1/2] wtforms/validators: tweak `InputRequired` docs Signed-off-by: William Woodruff --- src/wtforms/validators.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wtforms/validators.py b/src/wtforms/validators.py index 86337c99..7c29f3c2 100644 --- a/src/wtforms/validators.py +++ b/src/wtforms/validators.py @@ -300,7 +300,9 @@ class InputRequired: Note there is a distinction between this and DataRequired in that InputRequired looks that form-input data was provided, and DataRequired - looks at the post-coercion data. + looks at the post-coercion data. This means that fields must be passed + in through a `Form`'s `formdata` parameter in order to pass this + validator; fields passed in as keyword arguments will fail validation. Sets the `required` attribute on widgets. """ From e87f0862943172eefda88b58a87e9840fdccf312 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 31 May 2023 18:04:34 -0400 Subject: [PATCH 2/2] validators: feedback Signed-off-by: William Woodruff --- src/wtforms/validators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wtforms/validators.py b/src/wtforms/validators.py index 7c29f3c2..3c0db3b0 100644 --- a/src/wtforms/validators.py +++ b/src/wtforms/validators.py @@ -300,9 +300,9 @@ class InputRequired: Note there is a distinction between this and DataRequired in that InputRequired looks that form-input data was provided, and DataRequired - looks at the post-coercion data. This means that fields must be passed - in through a `Form`'s `formdata` parameter in order to pass this - validator; fields passed in as keyword arguments will fail validation. + looks at the post-coercion data. This means that this validator only checks + whether non-empty data was sent, not whether non-empty data was coerced + from that data. Initially populated data is not considered sent. Sets the `required` attribute on widgets. """