django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
813 stars 289 forks source link

Use set value of strip in fields that inherit from forms.CharField. #392

Closed benkonrath closed 4 years ago

benkonrath commented 4 years ago

django.forms.CharField already strips the white space if requested. The default is True which is why it's safe to just remove the strip() in these form fields. https://docs.djangoproject.com/en/2.2/ref/forms/fields/#django.forms.CharField.strip

claudep commented 4 years ago

Nice! I wouldn't add the versionchanged directives if the functionality is unchanged (which seems the case).

benkonrath commented 4 years ago

Ok, I wasn't sure about the versionchanged. Previously the value of strip would have been ignored which is why I considered it changed. But you're right that there's not a functional change like in #391. I'll remove it.

codecov-io commented 4 years ago

Codecov Report

Merging #392 into master will decrease coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
- Coverage   95.88%   95.87%   -0.01%     
==========================================
  Files         162      162              
  Lines        4006     4004       -2     
  Branches      532      532              
==========================================
- Hits         3841     3839       -2     
  Misses         99       99              
  Partials       66       66
Impacted Files Coverage Δ
localflavor/si/forms.py 100% <ø> (ø) :arrow_up:
localflavor/gb/forms.py 92.3% <100%> (ø) :arrow_up:
localflavor/za/forms.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6993c59...07ec50e. Read the comment docs.