Skip to content

CharField: allow_blank=False in combination with trim_whitespace=True does not behave as expected #2710

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

Closed
johtso opened this issue Mar 18, 2015 · 1 comment

Comments

@johtso
Copy link
Contributor

johtso commented Mar 18, 2015

The two options can not be used in combination to raise a validation error if the incoming data purely consists of whitespace because to_internal_value is not applied before validation.

Is this something that could be changed? And is there a way for me to achieve this behaviour currently without writing custom validation?

@tomchristie
Copy link
Member

Sounds like a totally valid improvement to make, to me.

johtso added a commit to johtso/django-rest-framework that referenced this issue Mar 18, 2015
@tomchristie tomchristie added this to the 3.1.4 Release milestone Jun 24, 2015
@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants