From e9a0f23dc7f7ea38ecb72c292cce9185797fb7cc Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 26 Jan 2017 13:01:59 -0200 Subject: [PATCH] Fix #662 --- sapl/materia/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 84a60dcb6..258765a2a 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -174,7 +174,9 @@ class RelatoriaForm(ModelForm): def __init__(self, *args, **kwargs): super(RelatoriaForm, self).__init__(*args, **kwargs) self.fields['parlamentar'].queryset = Parlamentar.objects.filter( - ativo=True).order_by('nome_completo') + ativo=True, id__in=Participacao.objects.filter( + composicao_id=self.initial['comissao'] + ).values_list('parlamentar_id')).order_by('nome_completo') def clean(self): cleaned_data = self.cleaned_data