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

IntegerField should check type when process data #451

Merged
merged 1 commit into from Dec 17, 2019
Merged

Conversation

whusnoopy
Copy link
Contributor

@whusnoopy whusnoopy commented Nov 8, 2018

Core fields like IntegerField will check type on process_formdata by reload from base Field, but not check on process_data in current version. If we pass unsupported type in data for Form, like a string 'x', the form won't raise any error and will pass the origin string as value for user, it doesn't make sense for this case.

As BooleanField did in process_data, IntegerField should do the same thing, so I add the progress and test case for IntegerField.

Maybe other fields in fields/core.py like FloatField should do type check in progress_data also.

@ftm
Copy link
Contributor

@ftm ftm commented Dec 17, 2019

Thank you for adding this fix, apologies for not accepting the PR for over a year.

@ftm ftm merged commit 9f66d7e into wtforms:master Dec 17, 2019
1 check passed
azmeuk added a commit to azmeuk/wtforms that referenced this issue Apr 20, 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.

None yet

2 participants