From 6b92694267ca9d4a9908ab1ce36be8f2d4035340 Mon Sep 17 00:00:00 2001 From: Leandro Roberto da Silva Date: Thu, 3 Nov 2016 10:27:28 -0200 Subject: [PATCH] =?UTF-8?q?HOT-FIX=20erro=20na=20pesquisa=20sem=20sele?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20ordem.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sapl/utils.py b/sapl/utils.py index ecf91e613..e4786085c 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -490,7 +490,8 @@ class MateriaPesquisaOrderingFilter(django_filters.OrderingFilter): super(MateriaPesquisaOrderingFilter, self).__init__(*args, **kwargs) def filter(self, qs, value): - return super().filter(qs, self.order_by_mapping[value[0]]) + _value = self.order_by_mapping[value[0]] if value else value + return super().filter(qs, _value) class AnoNumeroOrderingFilter(django_filters.OrderingFilter): @@ -509,7 +510,8 @@ class AnoNumeroOrderingFilter(django_filters.OrderingFilter): super(AnoNumeroOrderingFilter, self).__init__(*args, **kwargs) def filter(self, qs, value): - return super().filter(qs, self.order_by_mapping[value[0]]) + _value = self.order_by_mapping[value[0]] if value else value + return super().filter(qs, _value) def gerar_hash_arquivo(arquivo, pk, block_size=2**20):