From 116903524f5724813be5e95e5341583f7fe09feb Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 2 Aug 2017 14:24:23 -0300 Subject: [PATCH] Conserta bug --- sapl/materia/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 94eae9a57..93c16dfa5 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1186,7 +1186,8 @@ def autores_ativos(materia, tipo=None): content_type__in=ct_list).order_by( 'nome' ) - + # import ipdb; + # ipdb.set_trace() if not tipo: autor_qs = Autor.objects.none() for key in autores_by_ct: @@ -1195,10 +1196,11 @@ def autores_ativos(materia, tipo=None): return (autor_qs | autores_by_ct['others']).order_by('nome') else: + tipo_autor = tipo if not tipo in autores_by_ct: - tipo = 'others' + tipo_autor = 'others' - return autores_by_ct[tipo].order_by('nome') + return autores_by_ct[tipo_autor].filter(tipo_id=tipo).order_by('nome') def atualizar_autores(request):