django / django-localflavor

Country-specific Django helpers, formerly of contrib fame

Home Page:https://django-localflavor.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ar.forms.ARCBUField check digit calculation is incorrect

arthurdejong opened this issue · comments

The check digit calculation in ar.forms.ARCBUField is probably incorrect. It does not seem to validate the "28505909 40090418135201" example from https://es.wikipedia.org/wiki/Clave_Bancaria_Uniforme

Note that python-stdnum (disclaimer: I'm the author) already has a pretty well tested implementation and localflavor already depends on it.

If you like, I can make a PR that switches ARCBUField to python-stdnum.

Nice work on python-stdnum! A PR for fixing this issue by using python-stdnum would be great - thanks for the offer.

Side note: I'm planning to make a package that generates Django models and forms for all of python-stdnum. I think it makes sense to do this outside of django-localflavor (e.g. create a django-stdnum package) but I want to validate my idea first with a proof of concept and then check with the Django community on a way forward. Having the fix you propose in the next release will still be good.