diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 937831ea2..fb5fbd216 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -958,6 +958,12 @@ class TramitacaoCrud(MasterDetailCrud): def form_valid(self, form): self.object = form.save() + if form.instance.status.indicador == 'F': + form.instance.materia.em_tramitacao = False + else: + form.instance.materia.em_tramitacao = True + form.instance.materia.save() + try: tramitacao_signal.send(sender=Tramitacao, post=self.object, @@ -981,6 +987,12 @@ class TramitacaoCrud(MasterDetailCrud): def form_valid(self, form): self.object = form.save() + if form.instance.status.indicador == 'F': + form.instance.materia.em_tramitacao = False + else: + form.instance.materia.em_tramitacao = True + form.instance.materia.save() + try: tramitacao_signal.send(sender=Tramitacao, post=self.object,