# HG changeset patch # User RĂ©mi Cardona # Date 1442238158 -7200 # Node ID 44c52385d2d8362a03a46b4019aeff7d87579c44 # Parent 3a7ce5c9fe35cf19ff6500dde2e9a12910b44632 [web/facet] Simplify reversed/sorted calls diff -r 3a7ce5c9fe35 -r 44c52385d2d8 web/facet.py --- a/web/facet.py Mon Sep 28 13:47:30 2015 +0200 +++ b/web/facet.py Mon Sep 14 15:42:38 2015 +0200 @@ -922,9 +922,7 @@ if self.rql_sort: return [(_(value), value) for value, in rset] values = [(_(value), value) for value, in rset] - if self.sortasc: - return sorted(values) - return reversed(sorted(values)) + return sorted(values, reverse=not self.sortasc) class AttributeFacet(RelationAttributeFacet):