Skip to content

fix: require both control digits for 12-digit INN#475

Open
santhreal wants to merge 1 commit into
python-validators:masterfrom
santhreal:fix/ru-inn-control-digits-v3
Open

fix: require both control digits for 12-digit INN#475
santhreal wants to merge 1 commit into
python-validators:masterfrom
santhreal:fix/ru-inn-control-digits-v3

Conversation

@santhreal

Copy link
Copy Markdown

validators.i18n.ru.ru_inn hits false-accept when 12-digit INN ternary precedence skips first control digit when both controls <=9. This PR fixes the regression with a focused test covering the case.

Nested ternary precedence skipped the first control when both were <=9,
so invalid numbers like 000000000018 were accepted. Compare both checks
via % 10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant