From 4c026df19100ad75c144884270d97090ff557065 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Mon, 12 Jun 2017 10:40:53 -0300 Subject: [PATCH] =?UTF-8?q?Corrige=20bug=20na=20pesquisa=20de=20poss=C3=AD?= =?UTF-8?q?veis=20autores.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/api/views.py | 7 +++++-- sapl/parlamentares/models.py | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) 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: