Browse Source

HOT-FIX erro na pesquisa sem seleção de ordem.

pull/778/head
Leandro Roberto da Silva 8 years ago
committed by GitHub
parent
commit
6b92694267
  1. 6
      sapl/utils.py

6
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):

Loading…
Cancel
Save