From 2434f3266cb570f2aee1c68ba1f6fd1ba176c9ae Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Tue, 29 Jan 2019 15:00:54 -0200 Subject: [PATCH] HOTFIX - Retira erro para Legislatura com data_fim vazia --- sapl/parlamentares/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index b1ee14629..d88f2fd87 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -28,10 +28,14 @@ class Legislatura(models.Model): def atual(self): current_year = timezone.now().year + if not self.data_fim: + self.data_fim = timezone.now().date() return self.data_inicio.year <= current_year <= self.data_fim.year @vigencia_atual def __str__(self): + if not self.data_fim: + self.data_fim = timezone.now().date() return _('%(numero)sÂȘ (%(start)s - %(end)s)') % { 'numero': self.numero, 'start': self.data_inicio.year,