From ae900ad0eaa63b1c5166033089a719fbc762b80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Thu, 21 Feb 2019 16:56:34 -0300 Subject: [PATCH] =?UTF-8?q?Adicionar=20comiss=C3=B5es=20que=20estiverem=20?= =?UTF-8?q?ativas=20em=20unidade=20destino=20de=20tramita=C3=A7=C3=A3o=20(?= =?UTF-8?q?#2530)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Corrige adição de unidade destino de tramitação * Update forms.py --- sapl/materia/forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 05e3d3161..41588f621 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -424,6 +424,11 @@ class TramitacaoForm(ModelForm): def __init__(self, *args, **kwargs): super(TramitacaoForm, self).__init__(*args, **kwargs) self.fields['data_tramitacao'].initial = timezone.now().date() + ust = UnidadeTramitacao.objects.select_related().all() + unidade_tramitacao_destino = [(ut.pk, ut) for ut in ust if ut.comissao and ut.comissao.ativa] + unidade_tramitacao_destino.extend([(ut.pk, ut) for ut in ust if ut.orgao]) + unidade_tramitacao_destino.extend([(ut.pk, ut) for ut in ust if ut.parlamentar]) + self.fields['unidade_tramitacao_destino'].choices = unidade_tramitacao_destino def clean(self): super(TramitacaoForm, self).clean()