django / django-localflavor

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

Fixed IBANFormField to support empty iban #297

Closed TomRaz closed 7 years ago

TomRaz commented 7 years ago

Currently, when using IBANField in django admin, and the field is nullable and blank=true, an exception is raised when trying to save the form without an iban. I added handling of this case in the IBANFormField. All Changes

codecov-io commented 7 years ago

Codecov Report

Merging #297 into master will decrease coverage by 0.04%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage   96.01%   95.97%   -0.05%     
==========================================
  Files         150      150              
  Lines        4167     4169       +2     
  Branches      567      568       +1     
==========================================
  Hits         4001     4001              
- Misses        107      108       +1     
- Partials       59       60       +1
Impacted Files Coverage Δ
localflavor/generic/forms.py 96.29% <0%> (-3.71%) :arrow_down:

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 7b92156...4102603. Read the comment docs.

benkonrath commented 7 years ago

Thanks for pointing out this issue and for the fix. It seems it's a general problem for a lot of the form fields that inherit forms.CharField. I'm working on a complete fix for all of the fields in #298. Let's keep this open until #298 is merged.