From 436fc63e52ff4969688a07c2474d346af749c0a4 Mon Sep 17 00:00:00 2001 From: cristian-longhi Date: Wed, 20 Dec 2017 10:47:08 -0200 Subject: [PATCH] =?UTF-8?q?Corrige=20erro=20na=20op=C3=A7=C3=A3o=20FECHAR?= =?UTF-8?q?=20VOTA=C3=87=C3=83O?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 887ade0fc..34d662486 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1823,10 +1823,10 @@ class VotacaoNominalAbstract(SessaoPermissionMixin): votacao.observacao = request.POST.get('observacao', None) if self.ordem: - votacao.materia_id = ordem.materia.id + votacao.materia_id = materia_votacao.materia.id votacao.ordem_id = ordem_id elif self.expediente: - votacao.materia_id = expediente.materia.id + votacao.materia_id = materia_votacao.materia.id votacao.expediente_id = expediente_id votacao.tipo_resultado_votacao = form.cleaned_data['resultado_votacao'] @@ -1840,11 +1840,11 @@ class VotacaoNominalAbstract(SessaoPermissionMixin): if self.ordem: voto_parlamentar = VotoParlamentar.objects.get_or_create( parlamentar_id=parlamentar_id, - ordem=ordem)[0] + ordem=materia_votacao)[0] elif self.expediente: voto_parlamentar = VotoParlamentar.objects.get_or_create( parlamentar_id=parlamentar_id, - expediente=expediente)[0] + expediente=materia_votacao)[0] voto_parlamentar.voto = voto voto_parlamentar.parlamentar_id = parlamentar_id @@ -1863,11 +1863,11 @@ class VotacaoNominalAbstract(SessaoPermissionMixin): # votação if self.ordem: VotoParlamentar.objects.filter( - ordem=ordem, + ordem=materia_votacao, votacao__isnull=True).delete() elif self.expediente: VotoParlamentar.objects.filter( - expediente=expediente, + expediente=materia_votacao, votacao__isnull=True).delete() return self.form_valid(form)