From f28cda2009b95573c7761340b56cc7f7cbcf7ff0 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 28 Aug 2018 13:20:26 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20ajusta=20recupera=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20data=20de=20protocolo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 82aea25dd..2cb6b679b 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -262,9 +262,13 @@ class MateriaLegislativa(models.Model): from sapl.protocoloadm.models import Protocolo if self.ano and self.numero_protocolo: try: - return Protocolo.objects.get( - ano=self.ano, - numero=self.numero_protocolo).data + protocolo = Protocolo.objects.get( + ano=self.ano, + numero=self.numero_protocolo) + if protocolo.timestamp: + return protocolo.timestamp.date() + else: + return protocolo.data except ObjectDoesNotExist: pass