From 56d622b185cfaa81e05c3371c23429a701f1d4d2 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 24 Oct 2018 17:40:36 +0000 Subject: [PATCH] Changed the generation of the 1id-index.txt file to not list individual drafts in states Candidate for WG Adoption and Call for WG Adoption Issued as group drafts. - Legacy-Id: 15612 --- ietf/idindex/index.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ietf/idindex/index.py b/ietf/idindex/index.py index cc92ab087..e07199020 100644 --- a/ietf/idindex/index.py +++ b/ietf/idindex/index.py @@ -221,6 +221,9 @@ def active_drafts_index_by_group(extra_values=()): # this returns a lot of data so try to be efficient active_state = State.objects.get(type="draft", slug="active") + wg_cand = State.objects.get(type="draft-stream-ietf", slug="wg-cand") + wg_adopt = State.objects.get(type="draft-stream-ietf", slug="c-adopt") + individual = Group.objects.get(acronym='none') groups_dict = dict((g.id, g) for g in Group.objects.all()) @@ -229,6 +232,10 @@ def active_drafts_index_by_group(extra_values=()): docs_dict = dict((d["name"], d) for d in Document.objects.filter(states=active_state).values(*extracted_values)) + # Special case for drafts with group set, but in state wg_cand: + for d in Document.objects.filter(states=active_state).filter(states__in=[wg_cand, wg_adopt]): + docs_dict[d.name]['group_id'] = individual.id + # add initial and latest revision time for time, doc_id in NewRevisionDocEvent.objects.filter(type="new_revision", doc__states=active_state).order_by('-time').values_list("time", "doc_id"): d = docs_dict.get(doc_id)