From 90b6cf4ba5808f453c23e7ecb19fcd47ddd6b7f1 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 21 Feb 2023 15:18:52 -0800 Subject: [PATCH] fix: Don't show replaced, expired or otherwise abandoned docs for AD (#5162) * fix: Don't show replaced, expired or otherwise abandoned docs for AD Fixes #5153 and #2889. * Fix filter conditions * Update ietf/doc/views_search.py Co-authored-by: Robert Sparks --------- Co-authored-by: Robert Sparks --- ietf/doc/views_search.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index de1f40260..ec540ba39 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -679,7 +679,27 @@ def docs_for_ad(request, name): results, meta = prepare_document_table(request, retrieve_search_results(form), form.data, max_results=500) results.sort(key=ad_dashboard_sort_key) del meta["headers"][-1] - # + + # filter out some results + results = [ + r + for r in results + if not ( + r.type_id == "charter" + and ( + r.group.state_id == "abandon" + or r.get_state_slug("charter") == "replaced" + ) + ) + and not ( + r.type_id == "draft" + and ( + r.get_state_slug("draft-iesg") == "dead" + or r.get_state_slug("draft") == "repl" + ) + ) + ] + for d in results: d.search_heading = ad_dashboard_group(d) #