From 48cb06d20dffbaa490f71fd4538d1ef1401d2e51 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 21 Sep 2023 16:38:41 -0500 Subject: [PATCH] fix: subseries specific docevent types. get_or_create contain relationship. remove spurious " --- ietf/sync/rfceditor.py | 6 +++--- ietf/templates/doc/index_subseries.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ietf/sync/rfceditor.py b/ietf/sync/rfceditor.py index 99b649c64..ece4931a1 100644 --- a/ietf/sync/rfceditor.py +++ b/ietf/sync/rfceditor.py @@ -680,9 +680,9 @@ def update_docs_from_rfc_index( if created: if first_sync_creating_subseries: subseries_doc.docevent_set.create(type=f"{subseries_slug}_history_marker", by=system, desc=f"No history of this {subseries_slug.upper()} document is currently available in the datatracker before this point") - subseries_doc.docevent_set.create(type="subseries_doc_created", by=system, desc=f"Created {subseries_doc_name} via sync to the rfc-index") - if not subseries_doc.relateddocument_set.filter(relationship_id="contains", target=doc).exists(): - subseries_doc.relateddocument_set.create(relationship_id="contains", target=doc) + subseries_doc.docevent_set.create(type=f"{subseries_slug}_doc_created", by=system, desc=f"Created {subseries_doc_name} via sync to the rfc-index") + _, relationship_created = subseries_doc.relateddocument_set.get_or_create(relationship_id="contains", target=doc) + if relationship_created: subseries_doc.docevent_set.create(type="sync_from_rfc_editor", by=system, desc=f"Added {doc.name} to {subseries_doc.name}") if first_sync_creating_subseries: rfc_events.append(doc.docevent_set.create(type=f"{subseries_slug}_history_marker", by=system, desc=f"No history of {subseries_doc.name.upper()} is currently available in the datatracker before this point")) diff --git a/ietf/templates/doc/index_subseries.html b/ietf/templates/doc/index_subseries.html index f87d7722a..aaca236d7 100644 --- a/ietf/templates/doc/index_subseries.html +++ b/ietf/templates/doc/index_subseries.html @@ -11,7 +11,7 @@
{{doc.name}}
{% for rfc in doc.contains %} -

{{rfc.name}} : {{rfc.title}}

+

{{rfc.name}} : {{rfc.title}}

{% endfor %}