From 336f88bbb30f232c1a8d72881e9abee941446c44 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 23 May 2017 18:32:54 -0300 Subject: [PATCH] Bug fix --- sapl/materia/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 8690bb17a..2cb4d54f6 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1717,10 +1717,12 @@ class TramitacaoEmLoteView(PrimeiraTramitacaoEmLoteView): 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() + if ('tramitacao__status' in qr and + 'tramitacao__unidade_tramitacao_destino' in qr): + 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