From ee2cbdfd9cd3bd0e18818a4f125df58f68da3f5c 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 56aeb58e2..2312ab721 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -611,12 +611,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