Skip to content

Commit b748403

Browse files
authored
Require ASCII digits in Russian INNs
1 parent 22786cc commit b748403

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/validators/i18n/ru.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""Russia."""
22

3+
# standard
4+
import re
5+
6+
# local
37
from validators.utils import validator
48

59

@@ -30,7 +34,7 @@ def ru_inn(value: str):
3034
- For 10-digit INN: checks 10th control digit
3135
- For 12-digit INN: checks both 11th and 12th control digits
3236
"""
33-
if not value:
37+
if not value or not re.fullmatch(r"[0-9]+", value):
3438
return False
3539

3640
try:

0 commit comments

Comments
 (0)