From 2a1ad89022e4cd99138bcf7b8352a0037c95dc83 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 16 Dec 2019 17:09:04 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20conserta=20formata=C3=A7=C3=A3o=20co?= =?UTF-8?q?mpila=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/compilacao/models.py | 10 +++++++--- sapl/norma/models.py | 5 +---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index bac67b535..7161df37a 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -251,10 +251,14 @@ class TextoArticulado(TimestampedMixin): 'property "epigrafe"') return str(self.content_object.epigrafe) else: - return _('%(tipo)s nº %(numero)s de %(data)s') % { + numero = self.numero + if numero.isnumeric(): + numero = '{0:,}'.format(int(self.numero)).replace(',', '.') + + return _('%(tipo)s nº %(numero)s, de %(data)s') % { 'tipo': self.tipo_ta, - 'numero': self.numero, - 'data': defaultfilters.date(self.data, "d \d\e F \d\e Y")} + 'numero': numero, + 'data': defaultfilters.date(self.data, "d \d\e F \d\e Y").lower()} def hash(self): from django.core import serializers diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 62cb33120..34174bcc6 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -192,10 +192,7 @@ class NormaJuridica(models.Model): @property def epigrafe(self): - return _('%(tipo)s nº %(numero)s de %(data)s') % { - 'tipo': self.tipo, - 'numero': self.numero, - 'data': defaultfilters.date(self.data, "d \d\e F \d\e Y")} + return self.__str__() def delete(self, using=None, keep_parents=False): texto_integral = self.texto_integral