Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validators are checked to see if they are callable and not a class #410

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

ftm
Copy link
Contributor

@ftm ftm commented Jun 12, 2018

Following on from #298, this implements the requested changes in the PR.

adrcad and others added 2 commits September 17, 2016 17:22
When doing *Field(*args, validators=[DummyValidator]), there is no check
on the callable received (DummyValidator). For builtin validators, if
this is not an instance, you get an incomprehensible error from
_run_validation_chain. This commit adds a check at field's
initialization time to ensure either a callable instance object or a
function has been given as a validator by raising a meaningful error
message.
@ftm ftm merged commit 8d90488 into master Jun 12, 2018
@ftm ftm deleted the field-callable-validator-check branch June 12, 2018 22:56
azmeuk added a commit to azmeuk/wtforms that referenced this pull request Apr 18, 2020
azmeuk added a commit to azmeuk/wtforms that referenced this pull request Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants