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 <paul@painless-security.com>
This commit is contained in:
Sangho Na 2024-07-22 06:14:02 +12:00 committed by GitHub
parent 363c01e711
commit a3e4e634fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -52,6 +52,15 @@ class IESGTests(TestCase):
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'))

View file

@ -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 = []