chore: flip sense of all_ids rfc dict

This commit is contained in:
Robert Sparks 2023-08-18 18:10:10 -05:00
parent c0e2bb4521
commit 05b71bb50c
No known key found for this signature in database
GPG key ID: 6E2A6A5775F91318
2 changed files with 3 additions and 2 deletions

View file

@ -34,7 +34,8 @@ def all_id_txt():
rfcs = dict()
for rfc in Document.objects.filter(type_id="rfc"):
draft = next(iter(rfc.related_that("became_rfc")), None)
rfcs[rfc.name] = draft.name if draft else rfc.name
if draft is not None:
rfcs[draft.name] = rfc.name
replacements = dict(RelatedDocument.objects.filter(target__states=State.objects.get(type="draft", slug="repl"),
relationship="replaces").values_list("target__name", "source__name"))

View file

@ -41,7 +41,7 @@ class IndexTests(TestCase):
# published
draft.set_state(State.objects.get(type="draft", slug="rfc"))
rfc = RfcFactory(number=1234)
rfc = RfcFactory(rfc_number=1234)
draft.relateddocument_set.create(relationship_id="became_rfc", target=rfc)
txt = all_id_txt()