Browse Source

Conserta bug

pull/1323/head
Eduardo Calil 9 years ago
parent
commit
116903524f
  1. 8
      sapl/materia/views.py

8
sapl/materia/views.py

@ -1186,7 +1186,8 @@ def autores_ativos(materia, tipo=None):
content_type__in=ct_list).order_by( content_type__in=ct_list).order_by(
'nome' 'nome'
) )
# import ipdb;
# ipdb.set_trace()
if not tipo: if not tipo:
autor_qs = Autor.objects.none() autor_qs = Autor.objects.none()
for key in autores_by_ct: 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') return (autor_qs | autores_by_ct['others']).order_by('nome')
else: else:
tipo_autor = tipo
if not tipo in autores_by_ct: 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): def atualizar_autores(request):

Loading…
Cancel
Save