From 2afcb89ace6e524c85722d09277722c9256f19a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 5 Feb 2019 14:19:24 -0200 Subject: [PATCH] =?UTF-8?q?Corrige=20bug=20caso=20Casa=20n=C3=A3o=20tenha?= =?UTF-8?q?=20gerente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/home/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py index bef5f52..1e92734 100644 --- a/sigi/apps/home/views.py +++ b/sigi/apps/home/views.py @@ -126,9 +126,9 @@ def chart_carteira(request): 'data': [{'value': r['total_casas'], 'color': colors.next(), 'highlight': highlights.next(), - 'label': Servidor.objects.get(pk=r['gerente_contas']).nome_completo + 'label': r['gerente_contas__nome_completo'] } - for r in CasaLegislativa.objects.all().values('gerente_contas').annotate(total_casas=Count('pk')).order_by('gerente_contas') + for r in CasaLegislativa.objects.all().values('gerente_contas__nome_completo').annotate(total_casas=Count('pk')).order_by('gerente_contas__nome_completo') ] }