From 750748afce1cf90444ee199369515a190f51df4a Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 27 Jul 2017 12:37:04 -0300 Subject: [PATCH] Fixes #1300 (#1310) --- sapl/materia/views.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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,