From 20fb9169378c266c2144d8a934b4c2e51e3727d4 Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Fri, 22 Mar 2019 17:27:50 -0300 Subject: [PATCH] Fix #2629 (#2644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #2629 * Faz modificações pedidas * Corrige bug --- sapl/base/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sapl/base/views.py b/sapl/base/views.py index 3723a18be..133c1b0d5 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -633,12 +633,13 @@ class RelatorioMateriasTramitacaoView(FilterView): qs = filtra_url_materias_em_tramitacao( qr, qs, 'tramitacao__status', 'status') - context['object_list'] = qs + li = [li1 for li1 in qs if li1.tramitacao_set.last() and li1.tramitacao_set.last().status.indicador != 'F'] + context['object_list'] = li qtdes = {} for tipo in TipoMateriaLegislativa.objects.all(): - qs = context['object_list'] - qtde = len(qs.filter(tipo_id=tipo.id)) + li = context['object_list'] + qtde = sum(1 for i in li if i.tipo_id==tipo.id) if qtde > 0: qtdes[tipo] = qtde context['qtdes'] = qtdes