From 8d13b68cbfe8698d4e884b9f59757bc7c0d1a66f Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Sun, 19 Jul 2026 16:41:35 +0200 Subject: [PATCH] fix: on search, order then truncate in all branches (#11250) --- ietf/doc/views_search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 4232d77f6c4..5d59adb349f 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -260,6 +260,10 @@ def retrieve_search_results(form, all_types=False): docs=docs.distinct() + # order by time here to retain the most recent documents in case we + # find too many and have to chop the results list in prepare_document_table + docs = docs.order_by('-time') + return docs