From 840c6e3b999848cb117b51ef9c4a3cb94cd47678 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Tue, 29 Sep 2015 14:13:46 -0300 Subject: [PATCH] =?UTF-8?q?Fix=20name=20nominal=20and=20presen=C3=A7as?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sessao/urls.py | 6 +++--- sessao/views.py | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sessao/urls.py b/sessao/urls.py index 7e15d04b8..91667bf57 100644 --- a/sessao/urls.py +++ b/sessao/urls.py @@ -7,7 +7,7 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView, OradorExpedienteDelete, OradorExpedienteEdit, OradorExpedienteView, PainelView, PresencaOrdemDiaView, PresencaView, ResumoView, - VotacaoNomimalEditView, VotacaoNomimalView, + VotacaoNominalEditView, VotacaoNominalView, VotacaoSecretaEditView, VotacaoSecretaView, VotacaoSimbolicaEditView, VotacaoSimbolicaView, sessao_crud, tipo_expediente_crud, @@ -51,9 +51,9 @@ urlpatterns_sessao = sessao_crud.urlpatterns + [ url(r'^(?P\d+)/explicacao/editar/(?P\d+)$', ExplicacaoEdit.as_view(), name='explicacaoeditar'), url(r'^(?P\d+)/matordemdia/votnom/(?P\d+)/(?P\d+)$', - VotacaoNomimalView.as_view(), name='votacaonominal'), + VotacaoNominalView.as_view(), name='votacaonominal'), url(r'^(?P\d+)/matordemdia/votnom/edit/(?P\d+)/(?P\d+)$', - VotacaoNomimalEditView.as_view(), name='votacaonominaledit'), + VotacaoNominalEditView.as_view(), name='votacaonominaledit'), url(r'^(?P\d+)/matordemdia/votsec/(?P\d+)/(?P\d+)$', VotacaoSecretaView.as_view(), name='votacaosecreta'), url(r'^(?P\d+)/matordemdia/votsec/view/(?P\d+)/(?P\d+)$', diff --git a/sessao/views.py b/sessao/views.py index e1413fd65..df8018f38 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -1314,7 +1314,7 @@ class VotacaoSimbolicaView(FormMixin, sessao_crud.CrudDetailView): materia_id = kwargs['oid'] ordem_id = kwargs['mid'] - qtde_presentes = len(SessaoPlenariaPresenca.objects.filter( + qtde_presentes = len(PresencaOrdemDia.objects.filter( sessao_plen_id=self.object.id)) qtde_votos = (int(request.POST['votos_sim']) + int(request.POST['votos_nao']) + @@ -1388,7 +1388,7 @@ class VotacaoSecretaView(FormMixin, sessao_crud.CrudDetailView): materia_id = kwargs['oid'] ordem_id = kwargs['mid'] - qtde_presentes = len(SessaoPlenariaPresenca.objects.filter( + qtde_presentes = len(PresencaOrdemDia.objects.filter( sessao_plen_id=self.object.id)) qtde_votos = (int(request.POST['votos_sim']) + int(request.POST['votos_nao']) + @@ -1495,7 +1495,7 @@ class VotacaoNominalForm(forms.Form): pass -class VotacaoNomimalView(FormMixin, sessao_crud.CrudDetailView): +class VotacaoNominalView(FormMixin, sessao_crud.CrudDetailView): template_name = 'sessao/votacao/nominal.html' def get_success_url(self): @@ -1506,11 +1506,7 @@ class VotacaoNomimalView(FormMixin, sessao_crud.CrudDetailView): def get_parlamentares(self): self.object = self.get_object() - presencas = SessaoPlenariaPresenca.objects.filter( - sessao_plen_id=self.object.id - ) - - presencas = SessaoPlenariaPresenca.objects.filter( + presencas = PresencaOrdemDia.objects.filter( sessao_plen_id=self.object.id ) presentes = [p.parlamentar for p in presencas] @@ -1614,7 +1610,7 @@ class VotacaoNomimalView(FormMixin, sessao_crud.CrudDetailView): return self.form_invalid(form) -class VotacaoNomimalEditView(FormMixin, sessao_crud.CrudDetailView): +class VotacaoNominalEditView(FormMixin, sessao_crud.CrudDetailView): template_name = 'sessao/votacao/nominal_edit.html' def get(self, request, *args, **kwargs):