From 0df8ce4dc0de8089d66c5d08c49dcc4128de60e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Thu, 2 Nov 2017 00:27:31 +0000 Subject: [PATCH] =?UTF-8?q?Ne=20trie=20le=20queryset=20que=20si=20c'est=20?= =?UTF-8?q?lui=20qui=20est=20concern=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- re2o/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re2o/utils.py b/re2o/utils.py index 0fa6a84c..a6e5c851 100644 --- a/re2o/utils.py +++ b/re2o/utils.py @@ -248,7 +248,7 @@ class SortTable: if not fields: fields = values.get('default', []) request = request.order_by(*fields) - if order == 'desc': + if values.get(col, None) and order == 'desc': return request.reverse() else: return request