FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Refactor API: remove print from ru_inn, update description, and expose via __init__ by TheDrunkenBear · Pull Request #419 · python-validators/validators · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions src/validators/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL