diff --git a/sapl/api/views.py b/sapl/api/views.py index 1cb669599..4676f4017 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -238,9 +238,12 @@ class AutorListView(ListAPIView): q_filter = q_filter & q_fs qs = qs.filter(q_filter).distinct( - fields[0].fields_search[0][0]) + fields[0].fields_search[0][0]).order_by( + fields[0].fields_search[0][0]) + else: + qs = qs.order_by(fields[0].fields_search[0][0]) - qs = qs.order_by(fields[0].fields_search[0][0]).values_list( + qs = qs.values_list( 'id', fields[0].fields_search[0][0]) r += list(qs) diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 90532935b..4e50dea5c 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -1,9 +1,9 @@ from datetime import datetime -import reversion from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices +import reversion from sapl.base.models import Autor from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES, @@ -305,7 +305,6 @@ class Parlamentar(models.Model): ('nome_completo', '__icontains'), ('nome_parlamentar', '__icontains'), ('filiacao__partido__sigla', '__icontains'), - ('ativo', '', true_false_none), )) class Meta: