From e3806b52b49b20df05a9fb0d9ee8c85a3dbee908 Mon Sep 17 00:00:00 2001 From: Cesar Augusto de Carvalho Date: Fri, 12 Apr 2019 07:48:55 -0300 Subject: [PATCH] Adiciona campo regime tramitacao como obrigatorio (#2716) --- sapl/materia/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index f662c0fec..af78b20ff 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -1761,7 +1761,7 @@ class ConfirmarProposicaoForm(ProposicaoForm): required=False, widget=widgets.TextInput( attrs={'readonly': 'readonly'})) - regime_tramitacao = forms.ModelChoiceField( + regime_tramitacao = forms.ModelChoiceField(label="Regime de tramitação", required=False, queryset=RegimeTramitacao.objects.all()) gerar_protocolo = forms.ChoiceField( @@ -1827,6 +1827,10 @@ class ConfirmarProposicaoForm(ProposicaoForm): # esta chamada isola o __init__ de ProposicaoForm super(ProposicaoForm, self).__init__(*args, **kwargs) + if self.instance.tipo.content_type.model_class() ==\ + TipoMateriaLegislativa: + self.fields['regime_tramitacao'].required = True + fields = [ Fieldset( _('Dados Básicos'),