|
7 | 7 | from validators.utils import validator
|
8 | 8 |
|
9 | 9 |
|
10 |
| -def _nif_nie_validation(value: str, number_by_letter: Dict[str, str], special_cases: Set[str]): |
| 10 | +def _nif_nie_validation(value: str, number_by_letter: Dict[str, str]): |
11 | 11 | """Validate if the doi is a NIF or a NIE."""
|
12 |
| - if value in special_cases or len(value) != 9: |
| 12 | + if len(value) != 9: |
13 | 13 | return False
|
14 | 14 | value = value.upper()
|
15 | 15 | table = "TRWAGMYFPDXBNJZSQVHLCKE"
|
@@ -104,8 +104,7 @@ def es_nif(value: str, /):
|
104 | 104 | (ValidationError): If `value` is an invalid DOI string.
|
105 | 105 | """
|
106 | 106 | number_by_letter = {"L": "0", "M": "0", "K": "0"}
|
107 |
| - special_cases = {"X0000000T", "00000000T", "00000001R"} |
108 |
| - return _nif_nie_validation(value, number_by_letter, special_cases) |
| 107 | + return _nif_nie_validation(value, number_by_letter) |
109 | 108 |
|
110 | 109 |
|
111 | 110 | @validator
|
@@ -137,7 +136,7 @@ def es_nie(value: str, /):
|
137 | 136 | number_by_letter = {"X": "0", "Y": "1", "Z": "2"}
|
138 | 137 | # NIE must must start with X Y or Z
|
139 | 138 | if value and value[0] in number_by_letter:
|
140 |
| - return _nif_nie_validation(value, number_by_letter, {"X0000000T"}) |
| 139 | + return _nif_nie_validation(value, number_by_letter) |
141 | 140 | return False
|
142 | 141 |
|
143 | 142 |
|
|
0 commit comments