From 8a5826a9414ddc53cb721b069e19bf96e2c2c71a Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 5 Aug 2024 10:48:48 -0400 Subject: [PATCH] fix: redundant word in banner for Legacy stream documents (#7207) * fix: Remove redundant "stream stream" output fix: Change "Legacy stream" to "Legacy" chore: Add "stream" to stream.desc as needed Fixes: #6902 * chore: Remove unused stream_desc parameter The stream_desc key isn't used in template/doc/docuemnt_draft.html to don't pass it in nor compute it Fixes: #6902 * fix: migrate the legacy StreamName --------- Co-authored-by: Robert Sparks --- ietf/doc/views_doc.py | 8 +------ ietf/name/fixtures/names.json | 2 +- .../0014_change_legacy_stream_desc.py | 21 +++++++++++++++++++ ietf/secr/templates/telechat/doc.html | 2 +- .../doc/mail/last_call_announcement.txt | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 ietf/name/migrations/0014_change_legacy_stream_desc.py diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index dfef40e558..21c5eb235e 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -607,12 +607,7 @@ def document_main(request, name, rev=None, document_html=False): additional_urls = doc.documenturl_set.exclude(tag_id='auth48') # Stream description and name passing test - if doc.stream != None: - stream_desc = doc.stream.desc - stream = "draft-stream-" + doc.stream.slug - else: - stream_desc = "(None)" - stream = "(None)" + stream = ("draft-stream-" + doc.stream.slug) if doc.stream != None else "(None)" html = None js = None @@ -651,7 +646,6 @@ def document_main(request, name, rev=None, document_html=False): revisions=simple_diff_revisions if document_html else revisions, snapshot=snapshot, stream=stream, - stream_desc=stream_desc, latest_revision=latest_revision, latest_rev=latest_rev, can_edit=can_edit, diff --git a/ietf/name/fixtures/names.json b/ietf/name/fixtures/names.json index 3eb2c38d6f..59b367deb8 100644 --- a/ietf/name/fixtures/names.json +++ b/ietf/name/fixtures/names.json @@ -14058,7 +14058,7 @@ }, { "fields": { - "desc": "Legacy stream", + "desc": "Legacy", "name": "Legacy", "order": 6, "used": true diff --git a/ietf/name/migrations/0014_change_legacy_stream_desc.py b/ietf/name/migrations/0014_change_legacy_stream_desc.py new file mode 100644 index 0000000000..8297e86274 --- /dev/null +++ b/ietf/name/migrations/0014_change_legacy_stream_desc.py @@ -0,0 +1,21 @@ +# Copyright The IETF Trust 2024, All Rights Reserved + +from django.db import migrations + +def forward(apps, schema_editor): + StreamName = apps.get_model("name", "StreamName") + StreamName.objects.filter(pk="legacy").update(desc="Legacy") + +def reverse(apps, schema_editor): + StreamName = apps.get_model("name", "StreamName") + StreamName.objects.filter(pk="legacy").update(desc="Legacy stream") + +class Migration(migrations.Migration): + + dependencies = [ + ("name", "0013_narrativeminutes"), + ] + + operations = [ + migrations.RunPython(forward, reverse) + ] diff --git a/ietf/secr/templates/telechat/doc.html b/ietf/secr/templates/telechat/doc.html index 7891c1b1e7..6727e157f5 100644 --- a/ietf/secr/templates/telechat/doc.html +++ b/ietf/secr/templates/telechat/doc.html @@ -86,7 +86,7 @@

Ballot Writeup

Downward References

{% for ref in downrefs %}

Add {{ref.target.name}} - ({{ref.target.std_level}} - {{ref.target.stream.desc}}) + ({{ref.target.std_level}} - {{ref.target.stream.desc}} stream) to downref registry.
{% if not ref.target.std_level %} +++ Warning: The standards level has not been set yet!!!
diff --git a/ietf/templates/doc/mail/last_call_announcement.txt b/ietf/templates/doc/mail/last_call_announcement.txt index 8f15a8e2a6..5cf2e9c45b 100644 --- a/ietf/templates/doc/mail/last_call_announcement.txt +++ b/ietf/templates/doc/mail/last_call_announcement.txt @@ -33,7 +33,7 @@ No IPR declarations have been submitted directly on this I-D. {% if downrefs %} The document contains these normative downward references. See RFC 3967 for additional information: -{% for ref in downrefs %} {{ref.target.name}}: {{ref.target.title}} ({{ref.target.std_level}} - {{ref.target.stream.desc}}) +{% for ref in downrefs %} {{ref.target.name}}: {{ref.target.title}} ({{ref.target.std_level}} - {{ref.target.stream.desc}} stream) {% endfor %}{%endif%} {% endautoescape %}