Skip to content

Refactor API: remove print from ru_inn, update description, and expose via __init__ #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/validators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
fr_ssn,
ind_aadhar,
ind_pan,
ru_inn
)
from .iban import iban
from .ip_address import ipv4, ipv6
Expand Down Expand Up @@ -89,6 +90,7 @@
"fr_ssn",
"ind_aadhar",
"ind_pan",
"ru_inn",
# ...
"iban",
# ip_addresses
Expand Down
3 changes: 1 addition & 2 deletions src/validators/i18n/ru.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Russia INN."""
"""Russia."""

from validators.utils import validator

Expand Down Expand Up @@ -50,7 +50,6 @@ def ru_inn(value: str):
control_number1 = sum([d * w for d, w in zip(digits, weight_coefs1)]) % 11
weight_coefs2 = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8, 0]
control_number2 = sum([d * w for d, w in zip(digits, weight_coefs2)]) % 11
print(control_number1, control_number2, value)
return (
(control_number1 % 10) == digits[-2]
if control_number1 > 9
Expand Down
Loading