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

Fix saving a single space for empty postcode value. #280

Merged
merged 2 commits into from
Mar 6, 2017

Conversation

vdboor
Copy link
Contributor

@vdboor vdboor commented Mar 6, 2017

When the NLZipCodeField contains an empty string, it saves an empty space instead.
This PR updates the test code to check this, and provides the fix.

I've also applied len(value) logic found in the formfield NLZipCodeField.clean() so the models' to_python() becomes more rubust.

This also applies the `len(value)` logic found in the
formfield `NLZipCodeField.clean()` to be more rubust.
@jieter
Copy link
Contributor

jieter commented Mar 6, 2017

Looks good to me.

Copy link
Member

@benkonrath benkonrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vdboor. This PR just needs an entry to the changelog and your name added to the authors file.

vdboor added a commit to vdboor/django-localflavor that referenced this pull request Mar 6, 2017
@vdboor
Copy link
Contributor Author

vdboor commented Mar 6, 2017

@benkonrath I've added the entry! :-)

I was a bit confused about the Chicken & Egg issue to add a changelog for a PR that I didn't submit yet.

@benkonrath benkonrath merged commit 27454bd into django:master Mar 6, 2017
@benkonrath
Copy link
Member

Yeah, you just have to follow up with a second commit for the changelog entry. Thanks again.

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.

3 participants