Browse Source

Merge branch 'OradoresExplicacaoPessoal' of https://github.com/interlegis/sapl into OradoresExplicacaoPessoal

pull/3544/head
Gustavo 3 years ago
parent
commit
f4b41f2d68
  1. 6
      sapl/sessao/forms.py

6
sapl/sessao/forms.py

@ -605,8 +605,12 @@ class AdicionarVariasMateriasFilterSet(MateriaLegislativaFilterSet):
class OradorForm(ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
id_sessao = int(self.initial['id_sessao'])
sessao = SessaoPlenaria.objects.get(id=id_sessao)
legislatura_vigente = sessao.legislatura
self.fields['parlamentar'].queryset = \
Parlamentar.objects.filter(ativo=True).order_by('nome_parlamentar')
Parlamentar.objects.filter(mandato__legislatura=legislatura_vigente,
ativo=True).order_by('nome_parlamentar')
def clean(self):
super(OradorForm, self).clean()

Loading…
Cancel
Save