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

Validate character set for BICs #364

Closed raphaelm closed 5 years ago

raphaelm commented 5 years ago

Hi,

we've noted that a lot of our users try to input spaces into the BIC field and then run into the maxlength attribute silently. For example, if they want to input DEUTDEFFXXX, they end up inputting DEUTDEFF XX. As I understand SWIFT, all BICs are alphanumeric, even the branch codes. Therefore, I suggest

codecov-io commented 5 years ago

Codecov Report

Merging #364 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   95.93%   95.93%   +<.01%     
==========================================
  Files         157      157              
  Lines        3981     3983       +2     
  Branches      523      524       +1     
==========================================
+ Hits         3819     3821       +2     
  Misses         98       98              
  Partials       64       64
Impacted Files Coverage Δ
localflavor/generic/forms.py 100% <100%> (ø) :arrow_up:
localflavor/generic/validators.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 00fe4ec...0eca782. Read the comment docs.

benkonrath commented 5 years ago

Thanks for your contribution and for providing valuable insight into the problem that some users were running into with the validation. The PR looks good!