From f3bc43febd82b6ddf179c1cbb07454b47cf1751e Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Fri, 3 Mar 2017 16:05:03 -0300 Subject: [PATCH] =?UTF-8?q?Filtra=20parlamentares=20titulares=20da=20comis?= =?UTF-8?q?s=C3=A3o=20para=20relatoria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 41af777af..75f4ee4bb 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -781,6 +781,7 @@ class RelatoriaCrud(MasterDetailCrud): public = [RP_LIST, RP_DETAIL] class CreateView(MasterDetailCrud.CreateView): + def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) @@ -796,8 +797,9 @@ class RelatoriaCrud(MasterDetailCrud): parlamentares = [] for p in participacao: - parlamentares.append( - [p.parlamentar.id, p.parlamentar.nome_parlamentar]) + if p.titular: + parlamentares.append( + [p.parlamentar.id, p.parlamentar.nome_parlamentar]) context['form'].fields['parlamentar'].choices = parlamentares return context