# HG changeset patch # User Thierry Florac # Date 1545212442 -3600 # Node ID 1cefd3e1ba43c948c3799dfb0898c6e7a52c011d # Parent 944a3e4a78ab3f38678107461c754a4f16e4c17e Updated default sort order diff -r 944a3e4a78ab -r 1cefd3e1ba43 src/pyams_content/features/search/portlet/__init__.py --- a/src/pyams_content/features/search/portlet/__init__.py Tue Dec 18 16:58:03 2018 +0100 +++ b/src/pyams_content/features/search/portlet/__init__.py Wed Dec 19 10:40:42 2018 +0100 @@ -17,6 +17,7 @@ from zope.schema.fieldproperty import FieldProperty +from pyams_content import _ from pyams_content.features.search import ISearchFolder from pyams_content.features.search.portlet.interfaces import ISearchResultsPortletSettings from pyams_content.shared.view.interfaces import RELEVANCE_ORDER @@ -26,8 +27,6 @@ from pyams_utils.request import check_request from pyams_utils.traversing import get_parent -from pyams_content import _ - SEARCH_RESULTS_PORTLET_NAME = 'pyams_content.portlet.search.results' @@ -47,7 +46,7 @@ if request is None: request = check_request() params = request.params - sort_index = params.get('order_by', RELEVANCE_ORDER) + sort_index = params.get('order_by', context.order_by) yield from context.get_results(context, sort_index, reverse=sort_index != RELEVANCE_ORDER, limit=limit,