From ba127a5058dfb78ec067c64bdb84e0e618161139 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 23 May 2017 18:10:48 -0300 Subject: [PATCH] Fix #1111 --- sapl/materia/views.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 4ff498cec..f71bfc373 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1714,3 +1714,17 @@ class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView): class TramitacaoEmLoteView(PrimeiraTramitacaoEmLoteView): filterset_class = TramitacaoEmLoteFilterSet + + def get_context_data(self, **kwargs): + context = super(TramitacaoEmLoteView, + self).get_context_data(**kwargs) + + qr = self.request.GET.copy() + + lista = filtra_tramitacao_destino_and_status( + qr['tramitacao__status'], + qr['tramitacao__unidade_tramitacao_destino']) + context['object_list'] = context['object_list'].filter( + id__in=lista).distinct() + + return context