From 7889b6a66435492e438a2875810b29906ea1d755 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 5 Oct 2015 10:40:13 -0300 Subject: [PATCH] =?UTF-8?q?Add=20cancelar=20mat=C3=A9ria=20in=20Registrar?= =?UTF-8?q?=20Vota=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sessao/views.py | 5 +++++ templates/sessao/votacao/votacao.html | 3 ++- templates/sessao/votacao/votacao_edit.html | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sessao/views.py b/sessao/views.py index 33ab48056..d7e06b153 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -1477,6 +1477,11 @@ class VotacaoView(FormMixin, sessao_crud.CrudDetailView): context.update({'form': form}) # ==================================================== + if 'cancelar-votacao' in request.POST: + ordem.votacao_aberta = False + ordem.save() + return self.form_valid(form) + if form.is_valid(): materia_id = kwargs['oid'] ordem_id = kwargs['mid'] diff --git a/templates/sessao/votacao/votacao.html b/templates/sessao/votacao/votacao.html index 2447ef9f5..ba43470ec 100644 --- a/templates/sessao/votacao/votacao.html +++ b/templates/sessao/votacao/votacao.html @@ -69,7 +69,8 @@

- + + {% endblock detail_content %} diff --git a/templates/sessao/votacao/votacao_edit.html b/templates/sessao/votacao/votacao_edit.html index f91de4af6..44367a98b 100644 --- a/templates/sessao/votacao/votacao_edit.html +++ b/templates/sessao/votacao/votacao_edit.html @@ -43,7 +43,7 @@

- + {% endblock detail_content %}