From 7441413032e848ff8e074f7aecc029eac1c264e9 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 17 Aug 2023 16:03:17 -0500 Subject: [PATCH] chore: merge in and adjust rfceditor.py changes --- ietf/sync/rfceditor.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ietf/sync/rfceditor.py b/ietf/sync/rfceditor.py index ce0cf2da2..b054db5e9 100644 --- a/ietf/sync/rfceditor.py +++ b/ietf/sync/rfceditor.py @@ -156,7 +156,7 @@ def update_drafts_from_queue(drafts): names = [t[0] for t in drafts] drafts_in_db = dict((d.name, d) - for d in Document.objects.filter(type="draft", docalias__name__in=names)) + for d in Document.objects.filter(type="draft", name__in=names)) changed = set() @@ -229,7 +229,7 @@ def update_drafts_from_queue(drafts): # remove tags and states for those not in the queue anymore - for d in Document.objects.exclude(docalias__name__in=names).filter(states__type="draft-rfceditor").distinct(): + for d in Document.objects.exclude(name__in=names).filter(states__type="draft-rfceditor").distinct(): d.tags.remove(*list(tag_mapping.values())) d.unset_state("draft-rfceditor") # we do not add a history entry here - most likely we already @@ -442,9 +442,6 @@ def update_docs_from_rfc_index( if created_rfc: rfc_changes.append(f"created document {prettify_std_name(doc.name)}") # Create DocAlias (for consistency until we drop DocAlias altogether) - alias, _ = DocAlias.objects.get_or_create(name=doc.name) - alias.docs.add(doc) - rfc_changes.append(f"created alias {prettify_std_name(doc.name)}") doc.set_state(rfc_published_state) if draft: doc.formal_languages.set(draft.formal_languages.all()) @@ -654,12 +651,15 @@ def update_docs_from_rfc_index( ) ) - if also: - for a in also: - a = a.lower() - if not DocAlias.objects.filter(name=a): - DocAlias.objects.create(name=a).docs.add(doc) - rfc_changes.append(f"created alias {prettify_std_name(a)}") + # This block attempted to alias subseries names to RFCs. + # Handle that differently when we add subseries as a document type. + # + # if also: + # for a in also: + # a = a.lower() + # if not DocAlias.objects.filter(name=a): + # DocAlias.objects.create(name=a).docs.add(doc) + # rfc_changes.append(f"created alias {prettify_std_name(a)}") doc_errata = errata.get(f"RFC{rfc_number}", []) all_rejected = doc_errata and all(