From 3ee9b6dd6be88cbc7b9fee9a07cc50858556df05 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 8 Mar 2016 19:07:26 -0300 Subject: [PATCH] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20mensagem=20de=20sucesso?= =?UTF-8?q?=20ao=20salvar=20presen=C3=A7as=20(ordem=20do=20dia=20e=20sess?= =?UTF-8?q?=C3=A3o)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sessao/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sessao/views.py b/sessao/views.py index cec59b46e..352fcaec2 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -1,6 +1,7 @@ from datetime import datetime from re import sub +from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.forms.utils import ErrorList @@ -66,6 +67,9 @@ class PresencaView(FormMixin, sessao_crud.CrudDetailView): sessao.parlamentar = Parlamentar.objects.get(id=p) sessao.save() + msg = _('Presença em Sessão salva com sucesso!') + messages.add_message(request, messages.SUCCESS, msg) + return self.form_valid(form) else: return self.form_invalid(form) @@ -124,6 +128,9 @@ class PresencaOrdemDiaView(FormMixin, sessao_crud.CrudDetailView): ordem.parlamentar = Parlamentar.objects.get(id=p) ordem.save() + msg = _('Presença em Ordem do Dia salva com sucesso!') + messages.add_message(request, messages.SUCCESS, msg) + return self.form_valid(form) else: return self.form_invalid(form)