From 72f7ef273a279e8d0017047b85293399ab3fdab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Fri, 3 Jul 2020 14:23:45 -0300 Subject: [PATCH] =?UTF-8?q?Realiza=20mudan=C3=A7as=20solicitadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/parlamentares/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index a325c6e52..2f2cd49c3 100755 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -217,11 +217,11 @@ class ParlamentarForm(FileFieldCheckMixin, ModelForm): attrs={'id': 'texto-rico'})} def save(self, commit=True): - parlamentar = super().save(commit=False) + parlamentar = super().save() autor = parlamentar.autor.first() - usuario = autor.user if parlamentar.autor else None + usuario = autor.user if autor else None - if parlamentar and autor and usuario: + if autor and usuario: usuario.is_active = parlamentar.ativo usuario.save()