From b0ce50d93a85ff88a5123ae31af338dd3f577610 Mon Sep 17 00:00:00 2001 From: Bruno Vieira Costa Date: Mon, 25 Nov 2024 10:48:27 -0300 Subject: [PATCH] =?UTF-8?q?Assert=20bairro=20at=C3=A9=2030=20chars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abstra_notas/nfse/sp/sao_paulo/envio_rps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/abstra_notas/nfse/sp/sao_paulo/envio_rps.py b/abstra_notas/nfse/sp/sao_paulo/envio_rps.py index afcd7ae..3346b04 100644 --- a/abstra_notas/nfse/sp/sao_paulo/envio_rps.py +++ b/abstra_notas/nfse/sp/sao_paulo/envio_rps.py @@ -241,6 +241,10 @@ def __post_init__(self): if self.endereco_cep is not None: self.endereco_cep = normalizar_cep(self.endereco_cep) + assert self.endereco_bairro is None or len( + self.endereco_bairro + ) <= 30, "O bairro deve ter no máximo 30 caracteres" + if self.endereco_uf is not None: if isinstance(self.endereco_uf, str): uf_str = self.endereco_uf