Skip to content

Commit 6321d3a

Browse files
committed
chore(rut): Refactor validation of DV in Rut.__init__()
1 parent 7fc3e84 commit 6321d3a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cl_sii/rut/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ def __init__(self, value: str | Rut, validate_dv: bool = False) -> None:
8181
self._dv = match_groups['dv']
8282

8383
if validate_dv:
84-
if Rut.calc_dv(self._digits) != self._dv:
85-
raise ValueError("RUT's \"digito verificador\" is incorrect.", value)
84+
self.validate_dv(raise_exception=True)
8685

8786
############################################################################
8887
# properties

0 commit comments

Comments
 (0)