Spanish ID card checksum validation fails on a specific case
|Reported by:||Marc Garcia||Owned by:||Marc Garcia|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The Spanish localflavor has a form field that validates a Spanish ID card number. The function calculates the algorithm based on a module 10 checksum. There is a specific case, when the result of the checksum is 0, that the function raises a "string index out of range" error. A simple transformation has to be applied on this case.