diff --git a/sapl/base/forms.py b/sapl/base/forms.py index d7f1f3a4c..4aa02c21b 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -48,7 +48,6 @@ class RelatorioMateriasTramitacaoilterSet(django_filters.FilterSet): fields = ['ano', 'tipo', 'tramitacao__unidade_tramitacao_local', 'tramitacao__status'] - def __init__(self, *args, **kwargs): super(RelatorioMateriasTramitacaoilterSet, self).__init__( *args, **kwargs) diff --git a/sapl/base/views.py b/sapl/base/views.py index 2f44fe039..db3ab016f 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -32,9 +32,13 @@ class RelatorioMateriasTramitacaoView(FilterView): context['title'] = _('Matérias por Ano, Autor e Tipo') + qs = context['object_list'] + qs = qs.filter(em_tramitacao=True) + context['object_list'] = qs + qtdes = {} for tipo in TipoMateriaLegislativa.objects.all(): - qs = kwargs['object_list'] + qs = context['object_list'] qtde = len(qs.filter(tipo_id=tipo.id)) if qtde > 0: qtdes[tipo] = qtde