From bf203d8ffeb7e321087a09caf7f909e022b3b01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 7 Dec 2016 15:23:59 -0200 Subject: [PATCH] Update views.py --- sapl/materia/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 5d1a71eb4..cef5e6622 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1149,8 +1149,8 @@ class MateriaLegislativaPesquisaView(FilterView): lista = filtra_tramitacao_destino(unidade_destino) qs = qs.filter(id__in=lista).distinct() - if 'o' not in self.request.GET: - qs = qs.order_by('tipo', 'ano', 'numero') + if 'o' in self.request.GET and not self.request.GET['o']: + qs = qs.order_by('-ano', '-numero') kwargs.update({ 'queryset': qs,