Skip to content

Fix empty string as a value for a validated DecimalField (#8064) #8067

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

Conversation

jerry40
Copy link
Contributor

@jerry40 jerry40 commented Jul 1, 2021

Closes #8064

When DecimalField (allow_null=True) has Max or Min validators , validation crashes on empty strings like '' and ' '.
Added a fix covered with a test.

@tomchristie
Copy link
Member

Fantastic bit of work, thanks!

@tomchristie tomchristie merged commit 98e56e0 into encode:master Jul 1, 2021
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending "" to a DecimalField with a min or a max value validator raises a TypeError
2 participants