From 0420beab0c43a1e995c6890976ea30223aac66ae Mon Sep 17 00:00:00 2001 From: AndreSouto Date: Tue, 6 Nov 2018 11:19:05 -0200 Subject: [PATCH] Fix Chamado #493294 --- sapl/materia/models.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 023c78d31..3d6afb694 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -261,18 +261,15 @@ class MateriaLegislativa(models.Model): ''' from sapl.protocoloadm.models import Protocolo if self.ano and self.numero_protocolo: - try: - protocolo = Protocolo.objects.filter( - ano=self.ano, - numero=self.numero_protocolo) - if protocolo.first().timestamp: - return protocolo.first().timestamp.date() - else: - return protocolo.data - except ObjectDoesNotExist: - pass - - return '' + protocolo = Protocolo.objects.filter( + ano=self.ano, + numero=self.numero_protocolo) + if protocolo.first().timestamp: + return protocolo.first().timestamp.date() + else: + return protocolo.data + else: + return '' def delete(self, using=None, keep_parents=False): if self.texto_original: