From a3e4e634fce72ee1e9ef75f5f207408999f1a94b Mon Sep 17 00:00:00 2001 From: Sangho Na Date: Mon, 22 Jul 2024 06:14:02 +1200 Subject: [PATCH] fix: Exclude replaced documents from IESG discusses (#7712) * fix: Exclude replaced documents from IESG discusses * test: Add checks for filtering replaced IESG drafts * chore: Improve replaced draft filter --------- Co-authored-by: Paul Selkirk --- ietf/iesg/tests.py | 9 +++++++++ ietf/iesg/views.py | 1 + 2 files changed, 10 insertions(+) diff --git a/ietf/iesg/tests.py b/ietf/iesg/tests.py index 7211a6bc06..4579316f22 100644 --- a/ietf/iesg/tests.py +++ b/ietf/iesg/tests.py @@ -52,6 +52,15 @@ def test_feed(self): self.assertContains(r, draft.name) self.assertContains(r, escape(pos.balloter.plain_name())) + # Mark draft as replaced + draft.set_state(State.objects.get(type="draft", slug="repl")) + + r = self.client.get(urlreverse("ietf.iesg.views.discusses")) + self.assertEqual(r.status_code, 200) + + self.assertNotContains(r, draft.name) + self.assertNotContains(r, escape(pos.balloter.plain_name())) + def test_milestones_needing_review(self): draft = WgDraftFactory() RoleFactory(name_id='ad',group=draft.group,person=Person.objects.get(user__username='ad')) diff --git a/ietf/iesg/views.py b/ietf/iesg/views.py index a219a6b5de..b67ef04a03 100644 --- a/ietf/iesg/views.py +++ b/ietf/iesg/views.py @@ -483,6 +483,7 @@ def discusses(request): models.Q(states__type__in=("statchg", "conflrev"), states__slug__in=("iesgeval", "defer")), docevent__ballotpositiondocevent__pos__blocking=True) + possible_docs = possible_docs.exclude(states__in=State.objects.filter(type="draft", slug="repl")) possible_docs = possible_docs.select_related("stream", "group", "ad").distinct() docs = []