diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 82fd7edf7..2900ee9a8 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -1,6 +1,8 @@ from datetime import datetime from bs4 import BeautifulSoup + +from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.translation import ugettext_lazy as _ @@ -783,7 +785,10 @@ def relatorio_sessao_plenaria(request, pk): rodape = get_rodape(casa) imagem = get_imagem(casa) - sessao = SessaoPlenaria.objects.get(id=pk) + try: + sessao = SessaoPlenaria.objects.get(id=pk) + except ObjectDoesNotExist: + raise Http404('Essa página não existe') (inf_basicas_dic, lst_mesa,