Skip to content

Commit

Permalink
chore(rut): Refactor validation of DV in Rut.__init__()
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrobles-cdd committed Oct 10, 2024
1 parent 7fc3e84 commit 6321d3a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cl_sii/rut/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def __init__(self, value: str | Rut, validate_dv: bool = False) -> None:
self._dv = match_groups['dv']

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

############################################################################
# properties
Expand Down

0 comments on commit 6321d3a

Please sign in to comment.