diff --git a/ietf/doc/models.py b/ietf/doc/models.py index 7d3286b9a..6c4cdc8bd 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -354,14 +354,11 @@ class DocumentInfo(models.Model): iesg_state_summary = iesg_state.name if iesg_substate: iesg_state_summary = iesg_state_summary + "::"+"::".join(tag.name for tag in iesg_substate) - - if state.slug == "rfc": - rfcs = self.related_that_doc("became_rfc") # should be only one - if len(rfcs) > 0: - rfc = rfcs[0].document - return f"Became RFC {rfc.rfc_number} ({rfc.std_level})" - else: - return "Became RFC" + + rfc = self.became_rfc() + if rfc: + return f"Became RFC {rfc.rfc_number} ({rfc.std_level})" + elif state.slug == "repl": rs = self.related_that("replaces") if rs: diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index 1eb409c59..16cc731bd 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -148,8 +148,8 @@ def fill_in_document_table_attributes(docs, have_telechat_date=False): ) # TODO - this likely reduces to something even simpler rel_rfcs = { - a.document.id: re.sub(r"rfc(\d+)", r"RFC \1", a.name, flags=re.IGNORECASE) - for a in Document.objects.filter( + d.id: re.sub(r"rfc(\d+)", r"RFC \1", d.name, flags=re.IGNORECASE) + for d in Document.objects.filter( type_id="rfc", id__in=[rel.source_id for rel in xed_by] ) } @@ -178,7 +178,7 @@ def augment_docs_with_related_docs_info(docs): if d.type_id == 'conflrev': if len(d.related_that_doc('conflrev')) != 1: continue - originalDoc = d.related_that_doc('conflrev')[0].document + originalDoc = d.related_that_doc('conflrev')[0] d.pages = originalDoc.pages def prepare_document_table(request, docs, query=None, max_results=200):