From eaef23aa70d63f379d8c67e9ff86696b14f90ed6 Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Tue, 26 Feb 2019 11:25:43 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX=20-=20Insere=20log=20na=20tela=20de=20c?= =?UTF-8?q?ompila=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/compilacao/views.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index f09ed8a4f..120c66645 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -2933,6 +2933,7 @@ class DispositivoDinamicEditView( class DispositivoSearchFragmentFormView(ListView): template_name = 'compilacao/dispositivo_form_search_fragment.html' + logger = logging.getLogger(__name__) def get(self, request, *args, **kwargs): @@ -2955,14 +2956,20 @@ class DispositivoSearchFragmentFormView(ListView): messages.info( request, _('Não foram encontrados resultados ' 'com seus critérios de busca!')) + username = self.request.user.username + self.logger.error("user=" + username + ". Não foram encontrados " + "resultados com esses critérios de busca. " + "id_tipo_ta=".format(request.GET['tipo_ta'])) try: r = response.render() return response except Exception as e: - messages.error(request, "Erro - %s" % e) + messages.error(request, "Erro - %s" % str(e)) context = {} self.template_name = 'compilacao/messages.html' + username = self.request.user.username + self.logger.error("user=" + username + ". " + str(e)) return self.render_to_response(context) def get_queryset(self): @@ -3134,7 +3141,8 @@ class DispositivoSearchFragmentFormView(ListView): return r except Exception as e: - print(e) + username = self.request.user.username + self.logger.error("user=" + username + ". " + str(e)) class DispositivoSearchModalView(FormView):