From e4c3ce032de10d8e1f238f4ad62351a944545d5b Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 29 Sep 2016 13:53:04 -0300 Subject: [PATCH] Fix #662 --- sapl/materia/forms.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index cce976e88..1d481cce1 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -17,6 +17,7 @@ from sapl.comissoes.models import Comissao from sapl.crispy_layout_mixin import form_actions, to_row from sapl.norma.models import (LegislacaoCitada, NormaJuridica, TipoNormaJuridica) +from sapl.parlamentares.models import Parlamentar from sapl.settings import MAX_DOC_UPLOAD_SIZE from sapl.utils import (RANGE_ANOS, RangeWidgetOverride, autor_label, autor_modal) @@ -190,6 +191,11 @@ class RelatoriaForm(ModelForm): widgets = {'comissao': forms.Select(attrs={'disabled': 'disabled'})} + def __init__(self, *args, **kwargs): + super(RelatoriaForm, self).__init__(*args, **kwargs) + self.fields['parlamentar'].queryset = Parlamentar.objects.filter( + ativo=True).order_by('nome_completo') + def clean(self): cleaned_data = self.cleaned_data