From 0682c015e664882111345083ad6f3284e1a452f0 Mon Sep 17 00:00:00 2001 From: Lude Ribeiro Date: Thu, 18 Nov 2021 11:03:49 -0300 Subject: [PATCH] Fix #99 --- sigi/apps/casas/views.py | 5 ++++- sigi/apps/convenios/views.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 8aa29d4..741786d 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -2,6 +2,8 @@ import csv from datetime import datetime from functools import reduce + +from django.contrib import messages from sigi.apps.utils import to_ascii from geraldo.generators import PDFGenerator @@ -446,7 +448,8 @@ def visualizar_carrinho(request): def excluir_carrinho(request): if 'carrinho_casas' in request.session: del request.session['carrinho_casas'] - return HttpResponseRedirect('.') + messages.info(request, u'O carrinho foi esvaziado') + return HttpResponseRedirect('../../') @login_required diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index dd21f0e..e829d09 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -2,6 +2,7 @@ import csv import datetime +from django.contrib import messages from django.http.response import HttpResponseForbidden import ho.pisa as pisa from django.conf import settings @@ -114,7 +115,8 @@ def adicionar_convenios_carrinho(request, queryset=None, id=None): def excluir_carrinho(request): if 'carrinho_convenios' in request.session: del request.session['carrinho_convenios'] - return HttpResponseRedirect('.') + messages.info(request, u'O carrinho foi esvaziado') + return HttpResponseRedirect('../../') @login_required def deleta_itens_carrinho(request):