From d58bd9b957399e520ca90fedc576fb5d76670090 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Fri, 18 Nov 2022 15:53:24 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20conserta=20bug=20em=20estat=C3=ADsti?= =?UTF-8?q?cas=20de=20Norma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/norma/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sapl/norma/views.py b/sapl/norma/views.py index bccd5e328..d6d474590 100644 --- a/sapl/norma/views.py +++ b/sapl/norma/views.py @@ -274,13 +274,14 @@ class NormaCrud(Crud): class DetailView(Crud.DetailView): def get(self, request, *args, **kwargs): estatisticas_acesso_normas = AppConfig.objects.first().estatisticas_acesso_normas - if estatisticas_acesso_normas == 'S': + if estatisticas_acesso_normas == 'S' and \ + NormaJuridica.objects.filter(id=kwargs['pk']).exists(): NormaEstatisticas.objects.create(usuario=str(self.request.user), norma_id=kwargs['pk'], ano=timezone.now().year, horario_acesso=timezone.now()) - if not 'display' in request.GET and \ + if 'display' not in request.GET and \ not request.user.has_perm('norma.change_normajuridica'): ta = self.get_object().texto_articulado.first() if ta and ta.privacidade == STATUS_TA_PUBLIC: