From 823281ba6c80947c3ecf4834b26addf0bab0bdba Mon Sep 17 00:00:00 2001
From: Robert Sparks
Date: Fri, 18 Aug 2023 10:59:55 -0500
Subject: [PATCH] chore: first pass at clearing out canonical_name
---
ietf/api/tests.py | 6 +--
ietf/bin/rfc-editor-index-updates | 2 +-
ietf/doc/admin.py | 2 +-
ietf/doc/factories.py | 6 ---
ietf/doc/feeds.py | 22 +++++-----
ietf/doc/mails.py | 2 +-
ietf/doc/models.py | 26 ++++--------
ietf/doc/templatetags/ietf_filters.py | 14 +++----
ietf/doc/tests.py | 42 +++++++++----------
ietf/doc/tests_bofreq.py | 2 +-
ietf/doc/tests_conflict_review.py | 6 +--
ietf/doc/tests_rsab_ballot.py | 2 +-
ietf/doc/tests_status_change.py | 12 +++---
ietf/doc/tests_utils.py | 26 ++++++------
ietf/doc/utils.py | 18 ++++----
ietf/doc/utils_search.py | 2 +-
ietf/doc/views_conflict_review.py | 10 ++---
ietf/doc/views_doc.py | 18 ++++----
ietf/doc/views_status_change.py | 24 +++++------
ietf/group/views.py | 6 +--
ietf/iesg/views.py | 6 +--
ietf/meeting/tests_views.py | 8 ++--
ietf/person/models.py | 2 +-
ietf/secr/templates/telechat/doc.html | 2 +-
ietf/templates/doc/ballot/approvaltext.html | 2 +-
ietf/templates/doc/ballot/approve_ballot.html | 2 +-
.../doc/ballot/approve_downrefs.html | 8 ++--
ietf/templates/doc/ballot/ballot_issued.html | 4 +-
ietf/templates/doc/ballot/clear_ballot.html | 4 +-
ietf/templates/doc/ballot/defer_ballot.html | 4 +-
ietf/templates/doc/ballot/edit_position.html | 2 +-
ietf/templates/doc/ballot/lastcalltext.html | 2 +-
ietf/templates/doc/ballot/rfceditornote.html | 2 +-
.../doc/ballot/send_ballot_comment.html | 2 +-
ietf/templates/doc/ballot/undefer_ballot.html | 2 +-
ietf/templates/doc/ballot/writeupnotes.html | 2 +-
ietf/templates/doc/bofreq/change_editors.html | 2 +-
.../doc/bofreq/change_responsible.html | 2 +-
ietf/templates/doc/change_ad.html | 2 +-
ietf/templates/doc/change_title.html | 2 +-
.../doc/conflict_review/approval_text.txt | 4 +-
.../doc/conflict_review/approve.html | 4 +-
ietf/templates/doc/conflict_review/start.html | 4 +-
.../templates/doc/conflict_review/submit.html | 8 ++--
ietf/templates/doc/document_charter.html | 2 +-
.../doc/document_conflict_review.html | 4 +-
ietf/templates/doc/document_draft.html | 6 +--
ietf/templates/doc/document_html.html | 6 +--
ietf/templates/doc/document_info.html | 2 +-
.../templates/doc/document_referenced_by.html | 2 +-
ietf/templates/doc/document_references.html | 4 +-
ietf/templates/doc/document_rfc.html | 6 +--
.../templates/doc/document_status_change.html | 2 +-
.../doc/draft/change_shepherd_writeup.html | 4 +-
.../draft/rfceditor_note_duplicate_error.html | 2 +-
ietf/templates/doc/edit_action_holders.html | 2 +-
ietf/templates/doc/edit_authors.html | 2 +-
ietf/templates/doc/edit_field.html | 6 +--
ietf/templates/doc/edit_notify.html | 2 +-
.../doc/mail/last_call_announcement.txt | 2 +-
ietf/templates/doc/remind_action_holders.html | 2 +-
.../templates/doc/review/assign_reviewer.html | 2 +-
ietf/templates/doc/review/close_request.html | 2 +-
.../templates/doc/review/complete_review.html | 2 +-
.../doc/review/edit_request_comment.html | 2 +-
.../doc/review/edit_request_deadline.html | 2 +-
.../mark_reviewer_assignment_no_response.html | 2 +-
.../review/reject_reviewer_assignment.html | 2 +-
ietf/templates/doc/review/request_review.html | 2 +-
.../doc/review/submit_unsolicited_review.html | 2 +-
.../review/withdraw_reviewer_assignment.html | 2 +-
ietf/templates/doc/revisions_list.html | 4 +-
.../doc/search/search_result_row.html | 2 +-
ietf/templates/doc/shepherd_writeup.html | 4 +-
.../ad_approval_pending_email.txt | 2 +-
.../doc/status_change/approval_text.txt | 2 +-
ietf/templates/doc/status_change/approve.html | 4 +-
ietf/templates/doc/status_change/submit.html | 4 +-
.../group/group_entry_with_charter.txt | 2 +-
ietf/templates/iesg/agenda_conflict_doc.html | 2 +-
ietf/templates/iesg/agenda_conflict_doc.txt | 4 +-
ietf/templates/iesg/agenda_doc.html | 4 +-
ietf/templates/iesg/agenda_doc.txt | 2 +-
ietf/templates/iesg/moderator_doc.html | 2 +-
ietf/templates/meeting/activity_report.html | 2 +-
ietf/templates/meeting/group_materials.html | 4 +-
ietf/templates/meeting/group_proceedings.html | 4 +-
ietf/templates/person/profile.html | 6 +--
88 files changed, 223 insertions(+), 237 deletions(-)
diff --git a/ietf/api/tests.py b/ietf/api/tests.py
index ef2d4f710..e4ac5c170 100644
--- a/ietf/api/tests.py
+++ b/ietf/api/tests.py
@@ -993,7 +993,7 @@ class RfcdiffSupportTests(TestCase):
)
num_received = received
- received = self.getJson(dict(name=rfc.canonical_name()))
+ received = self.getJson(dict(name=rfc.name))
self.assertEqual(num_received, received, 'RFC by canonical name gives same result as by number')
received = self.getJson(dict(name=f'RfC {number}'))
@@ -1032,7 +1032,7 @@ class RfcdiffSupportTests(TestCase):
draft = reload_db_objects(draft)
# Some old rfcs had tombstones that shouldn't be used for comparisons
- received = self.getJson(dict(name=rfc.canonical_name()))
+ received = self.getJson(dict(name=rfc.name))
self.assertTrue(received['previous'].endswith('00'))
def do_rfc_with_broken_history_test(self, draft_name):
@@ -1048,7 +1048,7 @@ class RfcdiffSupportTests(TestCase):
received,
dict(
content_url=rfc.get_href(),
- name=rfc.canonical_name(),
+ name=rfc.name,
previous=f'{draft.name}-10',
previous_url= f'{settings.IETF_ID_ARCHIVE_URL}{draft.name}-10.txt',
),
diff --git a/ietf/bin/rfc-editor-index-updates b/ietf/bin/rfc-editor-index-updates
index 356c78d22..da9f85f9b 100755
--- a/ietf/bin/rfc-editor-index-updates
+++ b/ietf/bin/rfc-editor-index-updates
@@ -99,7 +99,7 @@ if newpid == 0:
pipe("%s -a %s %s" % (settings.RSYNC_BINARY,settings.RFC_TEXT_RSYNC_SOURCE,settings.RFC_PATH))
for rfc in new_rfcs:
rebuild_reference_relations(rfc)
- log("Updated references for %s"%rfc.canonical_name())
+ log("Updated references for %s"%rfc.name)
except:
subject = "Exception in updating references for new rfcs: %s : %s" % (sys.exc_info()[0],sys.exc_info()[1])
msg = "%s\n%s\n----\n%s"%(sys.exc_info()[0],sys.exc_info()[1],traceback.format_tb(sys.exc_info()[2]))
diff --git a/ietf/doc/admin.py b/ietf/doc/admin.py
index 3ebce516c..5061f1495 100644
--- a/ietf/doc/admin.py
+++ b/ietf/doc/admin.py
@@ -45,7 +45,7 @@ class RelatedDocumentInline(admin.TabularInline):
model = RelatedDocument
fk_name= 'source'
def this(self, instance):
- return instance.source.canonical_name()
+ return instance.source.name
readonly_fields = ['this', ]
fields = ['this', 'relationship', 'target', ]
raw_id_fields = ['target']
diff --git a/ietf/doc/factories.py b/ietf/doc/factories.py
index 49699b12a..d2b52f98a 100644
--- a/ietf/doc/factories.py
+++ b/ietf/doc/factories.py
@@ -119,12 +119,6 @@ class RfcFactory(BaseDocumentFactory):
else:
obj.set_state(State.objects.get(type_id='rfc',slug='published'))
- @factory.post_generation
- def reset_canonical_name(obj, create, extracted, **kwargs):
- if hasattr(obj, '_canonical_name'):
- del obj._canonical_name
- return None
-
class IndividualDraftFactory(BaseDocumentFactory):
diff --git a/ietf/doc/feeds.py b/ietf/doc/feeds.py
index c48ef041c..500ed3cb1 100644
--- a/ietf/doc/feeds.py
+++ b/ietf/doc/feeds.py
@@ -46,7 +46,7 @@ class DocumentChangesFeed(Feed):
raise FeedDoesNotExist
return urlreverse(
"ietf.doc.views_doc.document_history",
- kwargs=dict(name=obj.canonical_name()),
+ kwargs=dict(name=obj.name),
)
def subtitle(self, obj):
@@ -86,7 +86,7 @@ class DocumentChangesFeed(Feed):
return (
urlreverse(
"ietf.doc.views_doc.document_history",
- kwargs=dict(name=item.doc.canonical_name()),
+ kwargs=dict(name=item.doc.name),
)
+ "#history-%s" % item.pk
)
@@ -208,13 +208,13 @@ class RfcFeed(Feed):
return [doc for doc, time in results]
def item_title(self, item):
- return "%s : %s" % (item.canonical_name(), item.title)
+ return "%s : %s" % (item.name, item.title)
def item_description(self, item):
return item.abstract
def item_link(self, item):
- return "https://rfc-editor.org/info/%s" % item.canonical_name()
+ return "https://rfc-editor.org/info/%s" % item.name
def item_pubdate(self, item):
return item.publication_time
@@ -229,7 +229,7 @@ class RfcFeed(Feed):
for fmt, media_type in [("txt", "text/plain"), ("html", "text/html")]:
media_contents.append(
{
- "url": f"https://rfc-editor.org/rfc/{item.canonical_name()}.{fmt}",
+ "url": f"https://rfc-editor.org/rfc/{item.name}.{fmt}",
"media_type": media_type,
"is_format_of": self.item_link(item),
}
@@ -237,7 +237,7 @@ class RfcFeed(Feed):
if item.rfc_number not in [571, 587]:
media_contents.append(
{
- "url": f"https://www.rfc-editor.org/rfc/pdfrfc/{item.canonical_name()}.txt.pdf",
+ "url": f"https://www.rfc-editor.org/rfc/pdfrfc/{item.name}.txt.pdf",
"media_type": "application/pdf",
"is_format_of": self.item_link(item),
}
@@ -245,7 +245,7 @@ class RfcFeed(Feed):
else:
media_contents.append(
{
- "url": f"https://www.rfc-editor.org/rfc/{item.canonical_name()}.xml",
+ "url": f"https://www.rfc-editor.org/rfc/{item.name}.xml",
"media_type": "application/rfc+xml",
}
)
@@ -256,16 +256,16 @@ class RfcFeed(Feed):
]:
media_contents.append(
{
- "url": f"https://rfc-editor.org/rfc/{item.canonical_name()}.{fmt}",
+ "url": f"https://rfc-editor.org/rfc/{item.name}.{fmt}",
"media_type": media_type,
- "is_format_of": f"https://www.rfc-editor.org/rfc/{item.canonical_name()}.xml",
+ "is_format_of": f"https://www.rfc-editor.org/rfc/{item.name}.xml",
}
)
extra.update({"media_contents": media_contents})
- extra.update({"doi": "10.17487/%s" % item.canonical_name().upper()})
+ extra.update({"doi": "10.17487/%s" % item.name.upper()})
extra.update(
- {"doiuri": "http://dx.doi.org/10.17487/%s" % item.canonical_name().upper()}
+ {"doiuri": "http://dx.doi.org/10.17487/%s" % item.name.upper()}
)
# R104 Publisher (Mandatory - but we need a string from them first)
diff --git a/ietf/doc/mails.py b/ietf/doc/mails.py
index 5140614b0..c1e2074bc 100644
--- a/ietf/doc/mails.py
+++ b/ietf/doc/mails.py
@@ -202,7 +202,7 @@ def generate_last_call_announcement(request, doc):
doc.filled_title = textwrap.fill(doc.title, width=70, subsequent_indent=" " * 3)
- iprs = iprs_from_docs(related_docs(Document.objects.get(name=doc.canonical_name())))
+ iprs = iprs_from_docs(related_docs(Document.objects.get(name=doc.name)))
if iprs:
ipr_links = [ urlreverse("ietf.ipr.views.show", kwargs=dict(id=i.id)) for i in iprs]
ipr_links = [ settings.IDTRACKER_BASE_URL+url if not url.startswith("http") else url for url in ipr_links ]
diff --git a/ietf/doc/models.py b/ietf/doc/models.py
index 430ed97b2..d3d024d06 100644
--- a/ietf/doc/models.py
+++ b/ietf/doc/models.py
@@ -173,7 +173,7 @@ class DocumentInfo(models.Model):
if self.uploaded_filename:
self._cached_base_name = self.uploaded_filename
elif self.type_id == 'rfc':
- self._cached_base_name = "%s.txt" % self.canonical_name()
+ self._cached_base_name = "%s.txt" % self.name
elif self.type_id == 'draft':
if self.is_dochistory():
self._cached_base_name = "%s-%s.txt" % (self.doc.name, self.rev)
@@ -181,7 +181,7 @@ class DocumentInfo(models.Model):
self._cached_base_name = "%s-%s.txt" % (self.name, self.rev)
elif self.type_id in ["slides", "agenda", "minutes", "bluesheets", "procmaterials", ] and self.meeting_related():
ext = 'pdf' if self.type_id == 'procmaterials' else 'txt'
- self._cached_base_name = f'{self.canonical_name()}-{self.rev}.{ext}'
+ self._cached_base_name = f'{self.name}-{self.rev}.{ext}'
elif self.type_id == 'review':
# TODO: This will be wrong if a review is updated on the same day it was created (or updated more than once on the same day)
self._cached_base_name = "%s.txt" % self.name
@@ -189,9 +189,9 @@ class DocumentInfo(models.Model):
self._cached_base_name = "%s-%s.md" % (self.name, self.rev)
else:
if self.rev:
- self._cached_base_name = "%s-%s.txt" % (self.canonical_name(), self.rev)
+ self._cached_base_name = "%s-%s.txt" % (self.name, self.rev)
else:
- self._cached_base_name = "%s.txt" % (self.canonical_name(), )
+ self._cached_base_name = "%s.txt" % (self.name, )
return self._cached_base_name
def get_file_name(self):
@@ -507,7 +507,7 @@ class DocumentInfo(models.Model):
def replaces(self):
return set([ d for r in self.related_that_doc("replaces") for d in r.docs.all() ])
- def replaces_canonical_name(self):
+ def replaces_name(self):
s = set([ r.document for r in self.related_that_doc("replaces")])
first = list(s)[0] if s else None
return None if first is None else first.filename_with_rev()
@@ -540,7 +540,7 @@ class DocumentInfo(models.Model):
if self.get_state_slug() == "rfc":
try:
html = Path(
- os.path.join(settings.RFC_PATH, self.canonical_name() + ".html")
+ os.path.join(settings.RFC_PATH, self.name + ".html")
).read_text()
except (IOError, UnicodeDecodeError):
return None
@@ -805,7 +805,7 @@ class Document(DocumentInfo):
name = self.name
url = None
if self.type_id == "draft" and self.get_state_slug() == "rfc":
- name = self.canonical_name()
+ name = self.name
url = urlreverse('ietf.doc.views_doc.document_main', kwargs={ 'name': name }, urlconf="ietf.urls")
elif self.type_id in ('slides','bluesheets','recording'):
session = self.session_set.first()
@@ -844,7 +844,7 @@ class Document(DocumentInfo):
return e
def display_name(self):
- name = self.canonical_name()
+ name = self.name
if name.startswith('rfc'):
name = name.upper()
return name
@@ -1109,10 +1109,7 @@ class DocHistoryAuthor(DocumentAuthorInfo):
class DocHistory(DocumentInfo):
doc = ForeignKey(Document, related_name="history_set")
- # the name here is used to capture the canonical name at the time
- # - it would perhaps be more elegant to simply call the attribute
- # canonical_name and replace the function on Document with a
- # property
+
name = models.CharField(max_length=255)
def __str__(self):
@@ -1124,11 +1121,6 @@ class DocHistory(DocumentInfo):
def get_related_proceedings_material(self):
return self.doc.get_related_proceedings_material()
- def canonical_name(self):
- if hasattr(self, '_canonical_name'):
- return self._canonical_name
- return self.name
-
def latest_event(self, *args, **kwargs):
kwargs["time__lte"] = self.time
return self.doc.latest_event(*args, **kwargs)
diff --git a/ietf/doc/templatetags/ietf_filters.py b/ietf/doc/templatetags/ietf_filters.py
index 9d31811f2..4367ce1c0 100644
--- a/ietf/doc/templatetags/ietf_filters.py
+++ b/ietf/doc/templatetags/ietf_filters.py
@@ -139,7 +139,7 @@ def rfceditor_info_url(rfcnum : str):
return urljoin(settings.RFC_EDITOR_INFO_BASE_URL, f'rfc{rfcnum}')
-def doc_canonical_name(name):
+def doc_name(name):
"""Check whether a given document exists, and return its canonical name"""
def find_unique(n):
@@ -174,7 +174,7 @@ def doc_canonical_name(name):
def link_charter_doc_match(match):
- if not doc_canonical_name(match[0]):
+ if not doc_name(match[0]):
return match[0]
url = urlreverse(
"ietf.doc.views_doc.document_main",
@@ -187,7 +187,7 @@ def link_non_charter_doc_match(match):
name = match[0]
# handle "I-D.*"" reference-style matches
name = re.sub(r"^i-d\.(.*)", r"draft-\1", name, flags=re.IGNORECASE)
- cname = doc_canonical_name(name)
+ cname = doc_name(name)
if not cname:
return match[0]
if name == cname:
@@ -202,7 +202,7 @@ def link_non_charter_doc_match(match):
url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=cname))
return f'{match[0]} '
- cname = doc_canonical_name(name)
+ cname = doc_name(name)
if not cname:
return match[0]
if name == cname:
@@ -222,7 +222,7 @@ def link_non_charter_doc_match(match):
def link_other_doc_match(match):
doc = match[2].strip().lower()
rev = match[3]
- if not doc_canonical_name(doc + rev):
+ if not doc_name(doc + rev):
return match[0]
url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc + rev))
return f'{match[1]} '
@@ -268,7 +268,7 @@ def urlize_related_source_list(related, document_html=False):
names = set()
titles = set()
for rel in related:
- name=rel.source.canonical_name()
+ name=rel.source.name
title = rel.source.title
if name in names and title in titles:
continue
@@ -289,7 +289,7 @@ def urlize_related_target_list(related, document_html=False):
"""Convert a list of RelatedDocuments into list of links using the target document's canonical name"""
links = []
for rel in related:
- name=rel.target.canonical_name()
+ name=rel.target.name
title = rel.target.title
url = urlreverse('ietf.doc.views_doc.document_main' if document_html is False else 'ietf.doc.views_doc.document_html', kwargs=dict(name=name))
name = escape(name)
diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py
index 5969f4e83..cedc02c09 100644
--- a/ietf/doc/tests.py
+++ b/ietf/doc/tests.py
@@ -347,7 +347,7 @@ class SearchTests(TestCase):
self.assertEqual(r.status_code, 200)
self.assertContains(r, draft.name)
self.assertContains(r, escape(draft.action_holders.first().name))
- self.assertContains(r, rfc.canonical_name())
+ self.assertContains(r, rfc.name)
self.assertContains(r, conflrev.name)
self.assertContains(r, statchg.name)
self.assertContains(r, charter.name)
@@ -395,7 +395,7 @@ class SearchTests(TestCase):
r = self.client.get(urlreverse('ietf.doc.views_search.index_all_drafts'))
self.assertEqual(r.status_code, 200)
self.assertContains(r, draft.name)
- self.assertContains(r, rfc.canonical_name().upper())
+ self.assertContains(r, rfc.name.upper())
r = self.client.get(urlreverse('ietf.doc.views_search.index_active_drafts'))
self.assertEqual(r.status_code, 200)
@@ -642,7 +642,7 @@ Man Expires September 22, 2015 [Page 3]
if settings.USER_PREFERENCE_DEFAULTS['full_draft'] == 'off':
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=0")
@@ -650,7 +650,7 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "Active Internet-Draft")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=foo")
@@ -658,7 +658,7 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=1")
@@ -666,7 +666,7 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
self.client.cookies = SimpleCookie({str('full_draft'): str('on')})
@@ -675,7 +675,7 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
self.client.cookies = SimpleCookie({str('full_draft'): str('off')})
@@ -684,7 +684,7 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "Active Internet-Draft")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
self.client.cookies = SimpleCookie({str('full_draft'): str('foo')})
@@ -694,7 +694,7 @@ Man Expires September 22, 2015 [Page 3]
if settings.USER_PREFERENCE_DEFAULTS['full_draft'] == 'off':
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
- self.assertContains(r, replaced.canonical_name())
+ self.assertContains(r, replaced.name)
self.assertContains(r, replaced.title)
r = self.client.get(urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=draft.name)))
@@ -721,16 +721,16 @@ Man Expires September 22, 2015 [Page 3]
rfc = WgRfcFactory()
rfc.save_with_history([DocEventFactory(doc=rfc)])
(Path(settings.RFC_PATH) / rfc.get_base_name()).touch()
- r = self.client.get(urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.canonical_name())))
+ r = self.client.get(urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.name)))
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertEqual(q('title').text(), f'RFC {rfc.rfc_number} - {rfc.title}')
# synonyms for the rfc should be redirected to its canonical view
r = self.client.get(urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.rfc_number)))
- self.assertRedirects(r, urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.canonical_name())))
+ self.assertRedirects(r, urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.name)))
r = self.client.get(urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=f'RFC {rfc.rfc_number}')))
- self.assertRedirects(r, urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.canonical_name())))
+ self.assertRedirects(r, urlreverse("ietf.doc.views_doc.document_html", kwargs=dict(name=rfc.name)))
# expired draft
draft.set_state(State.objects.get(type="draft", slug="expired"))
@@ -757,7 +757,7 @@ Man Expires September 22, 2015 [Page 3]
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Replaced Internet-Draft")
- self.assertContains(r, replacement.canonical_name())
+ self.assertContains(r, replacement.name)
self.assertContains(r, replacement.title)
rel.delete()
@@ -787,13 +787,13 @@ Man Expires September 22, 2015 [Page 3]
self.assertContains(r, "RFC 123456")
self.assertContains(r, draft.name)
# obs/updates included with RFC
- self.assertContains(r, obsoleted.canonical_name())
+ self.assertContains(r, obsoleted.name)
self.assertContains(r, obsoleted.title)
- self.assertContains(r, obsoleted_by.canonical_name())
+ self.assertContains(r, obsoleted_by.name)
self.assertContains(r, obsoleted_by.title)
- self.assertContains(r, updated.canonical_name())
+ self.assertContains(r, updated.name)
self.assertContains(r, updated.title)
- self.assertContains(r, updated_by.canonical_name())
+ self.assertContains(r, updated_by.name)
self.assertContains(r, updated_by.title)
# naked RFC - also weird that we test a PS from the ISE
@@ -845,7 +845,7 @@ Man Expires September 22, 2015 [Page 3]
r = self.client.get(
urlreverse(
'ietf.doc.views_doc.document_main',
- kwargs={'name': draft.canonical_name()},
+ kwargs={'name': draft.name},
)
)
self.assertEqual(r.status_code, 200)
@@ -2698,20 +2698,20 @@ class Idnits2SupportTests(TestCase):
rfc = WgRfcFactory()
draft = WgDraftFactory()
draft.relateddocument_set.create(relationship_id="became_rfc", target=rfc)
- url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=rfc.canonical_name()))
+ url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=rfc.name))
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r,'rfcnum')
draft = WgDraftFactory()
- url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=draft.canonical_name()))
+ url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=draft.name))
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertNotContains(r,'rfcnum')
self.assertContains(r,'Unknown')
draft = WgDraftFactory(intended_std_level_id='ps')
- url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=draft.canonical_name()))
+ url = urlreverse('ietf.doc.views_doc.idnits2_state', kwargs=dict(name=draft.name))
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r,'Proposed')
diff --git a/ietf/doc/tests_bofreq.py b/ietf/doc/tests_bofreq.py
index cf01fe105..319ab778d 100644
--- a/ietf/doc/tests_bofreq.py
+++ b/ietf/doc/tests_bofreq.py
@@ -32,7 +32,7 @@ class BofreqTests(TestCase):
settings_temp_path_overrides = TestCase.settings_temp_path_overrides + ['BOFREQ_PATH']
def write_bofreq_file(self, bofreq):
- fname = Path(settings.BOFREQ_PATH) / ("%s-%s.md" % (bofreq.canonical_name(), bofreq.rev))
+ fname = Path(settings.BOFREQ_PATH) / ("%s-%s.md" % (bofreq.name, bofreq.rev))
with fname.open("w") as f:
f.write(f"""# This is a test bofreq.
Version: {bofreq.rev}
diff --git a/ietf/doc/tests_conflict_review.py b/ietf/doc/tests_conflict_review.py
index 2aa7a161c..a0d0da6c8 100644
--- a/ietf/doc/tests_conflict_review.py
+++ b/ietf/doc/tests_conflict_review.py
@@ -388,7 +388,7 @@ class ConflictReviewSubmitTests(TestCase):
# Right now, nothing to test - we let people put whatever the web browser will let them put into that textbox
# sane post using textbox
- path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.name, doc.rev))
self.assertEqual(doc.rev,'00')
self.assertFalse(os.path.exists(path))
r = self.client.post(url,dict(content="Some initial review text\n",submit_response="1"))
@@ -408,7 +408,7 @@ class ConflictReviewSubmitTests(TestCase):
# A little additional setup
# doc.rev is u'00' per the test setup - double-checking that here - if it fails, the breakage is in setUp
self.assertEqual(doc.rev,'00')
- path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.name, doc.rev))
with io.open(path,'w') as f:
f.write('This is the old proposal.')
f.close()
@@ -435,7 +435,7 @@ class ConflictReviewSubmitTests(TestCase):
self.assertEqual(r.status_code, 302)
doc = Document.objects.get(name='conflict-review-imaginary-irtf-submission')
self.assertEqual(doc.rev,'01')
- path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (doc.name, doc.rev))
with io.open(path) as f:
self.assertEqual(f.read(),"This is a new proposal.")
f.close()
diff --git a/ietf/doc/tests_rsab_ballot.py b/ietf/doc/tests_rsab_ballot.py
index ab2a58c00..028f54823 100644
--- a/ietf/doc/tests_rsab_ballot.py
+++ b/ietf/doc/tests_rsab_ballot.py
@@ -41,7 +41,7 @@ class IssueRSABBallotTests(TestCase):
self.client.login(username="rsab-chair", password="rsab-chair+password")
for name in [
- doc.canonical_name()
+ doc.name
for doc in (individual_draft, wg_draft, rg_draft, ed_rfc)
]:
url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=name))
diff --git a/ietf/doc/tests_status_change.py b/ietf/doc/tests_status_change.py
index a22465947..fdd53d3a6 100644
--- a/ietf/doc/tests_status_change.py
+++ b/ietf/doc/tests_status_change.py
@@ -396,9 +396,9 @@ class StatusChangeTests(TestCase):
self.assertTrue(notification['Subject'].startswith('Approved:'))
notification_text = get_payload_text(notification)
self.assertIn('The AD has approved changing the status', notification_text)
- self.assertIn(Document.objects.get(name='rfc9999').canonical_name(), notification_text)
- self.assertIn(Document.objects.get(name='rfc9998').canonical_name(), notification_text)
- self.assertNotIn(Document.objects.get(name='rfc14').canonical_name(), notification_text)
+ self.assertIn(Document.objects.get(name='rfc9999').name, notification_text)
+ self.assertIn(Document.objects.get(name='rfc9998').name, notification_text)
+ self.assertNotIn(Document.objects.get(name='rfc14').name, notification_text)
self.assertNotIn('No value found for', notification_text) # make sure all interpolation values were set
else:
self.assertEqual(len(outbox), 0)
@@ -501,7 +501,7 @@ class StatusChangeSubmitTests(TestCase):
# Right now, nothing to test - we let people put whatever the web browser will let them put into that textbox
# sane post using textbox
- path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
self.assertEqual(doc.rev,'00')
self.assertFalse(os.path.exists(path))
r = self.client.post(url,dict(content="Some initial review text\n",submit_response="1"))
@@ -520,7 +520,7 @@ class StatusChangeSubmitTests(TestCase):
# A little additional setup
# doc.rev is u'00' per the test setup - double-checking that here - if it fails, the breakage is in setUp
self.assertEqual(doc.rev,'00')
- path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
with io.open(path,'w') as f:
f.write('This is the old proposal.')
f.close()
@@ -552,7 +552,7 @@ class StatusChangeSubmitTests(TestCase):
self.assertEqual(r.status_code, 302)
doc = Document.objects.get(name='status-change-imaginary-mid-review')
self.assertEqual(doc.rev,'01')
- path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
with io.open(path) as f:
self.assertEqual(f.read(),"This is a new proposal.")
f.close()
diff --git a/ietf/doc/tests_utils.py b/ietf/doc/tests_utils.py
index 1f953b401..7357b5e1b 100644
--- a/ietf/doc/tests_utils.py
+++ b/ietf/doc/tests_utils.py
@@ -340,16 +340,16 @@ class RebuildReferenceRelationsTests(TestCase):
'Test conditions set up incorrectly: wrong prior document relationships')
for other_doc in [self.normative, self.informative, self.unknown]:
self.assertEqual(
- self.doc.relateddocument_set.filter(target__name=other_doc.canonical_name()).count(),
+ self.doc.relateddocument_set.filter(target__name=other_doc.name).count(),
0,
'Test conditions set up incorrectly: new documents already related',
)
def _get_refs_return_value(self):
return {
- self.normative.canonical_name(): Draft.REF_TYPE_NORMATIVE,
- self.informative.canonical_name(): Draft.REF_TYPE_INFORMATIVE,
- self.unknown.canonical_name(): Draft.REF_TYPE_UNKNOWN,
+ self.normative.name: Draft.REF_TYPE_NORMATIVE,
+ self.informative.name: Draft.REF_TYPE_INFORMATIVE,
+ self.unknown.name: Draft.REF_TYPE_UNKNOWN,
'draft-not-found': Draft.REF_TYPE_NORMATIVE,
}
@@ -388,9 +388,9 @@ class RebuildReferenceRelationsTests(TestCase):
self.assertCountEqual(
self.doc.relateddocument_set.values_list('target__name', 'relationship__slug'),
[
- (self.normative.canonical_name(), 'refnorm'),
- (self.informative.canonical_name(), 'refinfo'),
- (self.unknown.canonical_name(), 'refunk'),
+ (self.normative.name, 'refnorm'),
+ (self.informative.name, 'refinfo'),
+ (self.unknown.name, 'refunk'),
(self.updated.name, 'updates'),
]
)
@@ -419,9 +419,9 @@ class RebuildReferenceRelationsTests(TestCase):
self.assertCountEqual(
self.doc.relateddocument_set.values_list('target__name', 'relationship__slug'),
[
- (self.normative.canonical_name(), 'refnorm'),
- (self.informative.canonical_name(), 'refinfo'),
- (self.unknown.canonical_name(), 'refunk'),
+ (self.normative.name, 'refnorm'),
+ (self.informative.name, 'refinfo'),
+ (self.unknown.name, 'refunk'),
(self.updated.name, 'updates'),
]
)
@@ -451,9 +451,9 @@ class RebuildReferenceRelationsTests(TestCase):
self.assertCountEqual(
self.doc.relateddocument_set.values_list('target__name', 'relationship__slug'),
[
- (self.normative.canonical_name(), 'refnorm'),
- (self.informative.canonical_name(), 'refinfo'),
- (self.unknown.canonical_name(), 'refunk'),
+ (self.normative.name, 'refnorm'),
+ (self.informative.name, 'refinfo'),
+ (self.unknown.name, 'refunk'),
(self.updated.name, 'updates'),
]
)
diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py
index 4795cb486..d446ddf7b 100644
--- a/ietf/doc/utils.py
+++ b/ietf/doc/utils.py
@@ -56,7 +56,7 @@ def save_document_in_history(doc):
# copy fields
fields = get_model_fields_as_dict(doc)
fields["doc"] = doc
- fields["name"] = doc.canonical_name()
+ fields["name"] = doc.name
dochist = DocHistory(**fields)
dochist.save()
@@ -978,8 +978,8 @@ def make_rev_history(doc):
if e:
url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=e.doc))
history[url] = {
- 'name': e.doc.canonical_name(),
- 'rev': e.doc.canonical_name(),
+ 'name': e.doc.name,
+ 'rev': e.doc.name,
'published': e.time.isoformat(),
'url': url
}
@@ -1120,12 +1120,12 @@ def generate_idnits2_rfc_status():
# The explanation for 6312 is from before docalias was removed
# The workaround is still needed, even if the datatracker
# state no longer matches what's described here:
- # Document.get(docalias='rfc6312').rfc_number == 6342
- # 6312 was published with the wrong rfc number in it
- # weird workaround in the datatracker - there are two
- # DocAliases starting with rfc - the canonical name code
- # searches for the lexically highest alias starting with rfc
- # which is getting lucky.
+ # Document.get(docalias='rfc6312').rfc_number == 6342
+ # 6312 was published with the wrong rfc number in it
+ # weird workaround in the datatracker - there are two
+ # DocAliases starting with rfc - the canonical name code
+ # searches for the lexically highest alias starting with rfc
+ # which is getting lucky.
blob[6312 - 1] = 'O'
# RFC200 is an old RFC List by Number
diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py
index b9a378507..daeb34a0f 100644
--- a/ietf/doc/utils_search.py
+++ b/ietf/doc/utils_search.py
@@ -249,7 +249,7 @@ def prepare_document_table(request, docs, query=None, max_results=200):
if rfc_num is not None:
res.append(rfc_num)
else:
- res.append(d.canonical_name())
+ res.append(d.name)
return res
diff --git a/ietf/doc/views_conflict_review.py b/ietf/doc/views_conflict_review.py
index a31dd4d6a..ee9243781 100644
--- a/ietf/doc/views_conflict_review.py
+++ b/ietf/doc/views_conflict_review.py
@@ -171,7 +171,7 @@ class UploadForm(forms.Form):
return get_cleaned_text_file_content(self.cleaned_data["txt"])
def save(self, review):
- filename = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.canonical_name(), review.rev))
+ filename = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.name, review.rev))
with io.open(filename, 'w', encoding='utf-8') as destination:
if self.cleaned_data['txt']:
destination.write(self.cleaned_data['txt'])
@@ -185,7 +185,7 @@ def submit(request, name):
login = request.user.person
- path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.canonical_name(), review.rev))
+ path = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.name, review.rev))
not_uploaded_yet = review.rev == "00" and not os.path.exists(path)
if not_uploaded_yet:
@@ -202,7 +202,7 @@ def submit(request, name):
events = []
e = NewRevisionDocEvent(doc=review, by=login, type="new_revision")
- e.desc = "New version available: %s-%s.txt " % (review.canonical_name(), review.rev)
+ e.desc = "New version available: %s-%s.txt " % (review.name, review.rev)
e.rev = review.rev
e.save()
events.append(e)
@@ -234,7 +234,7 @@ def submit(request, name):
dict(),
))
else:
- filename = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.canonical_name(), review.rev))
+ filename = os.path.join(settings.CONFLICT_REVIEW_PATH, '%s-%s.txt' % (review.name, review.rev))
try:
with io.open(filename, 'r') as f:
init["content"] = f.read()
@@ -276,7 +276,7 @@ def edit_ad(request, name):
conflictdoc = review.relateddocument_set.get(relationship__slug='conflrev').target
- titletext = 'the conflict review of %s-%s' % (conflictdoc.canonical_name(),conflictdoc.rev)
+ titletext = 'the conflict review of %s-%s' % (conflictdoc.name,conflictdoc.rev)
return render(request, 'doc/change_ad.html',
{'form': form,
'doc': review,
diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py
index 075e6b5de..1475aade9 100644
--- a/ietf/doc/views_doc.py
+++ b/ietf/doc/views_doc.py
@@ -796,7 +796,7 @@ def document_main(request, name, rev=None, document_html=False):
))
elif doc.type_id == "conflrev":
- filename = "%s-%s.txt" % (doc.canonical_name(), doc.rev)
+ filename = "%s-%s.txt" % (doc.name, doc.rev)
pathname = os.path.join(settings.CONFLICT_REVIEW_PATH,filename)
if doc.rev == "00" and not os.path.isfile(pathname):
@@ -826,7 +826,7 @@ def document_main(request, name, rev=None, document_html=False):
))
elif doc.type_id == "statchg":
- filename = "%s-%s.txt" % (doc.canonical_name(), doc.rev)
+ filename = "%s-%s.txt" % (doc.name, doc.rev)
pathname = os.path.join(settings.STATUS_CHANGE_PATH,filename)
if doc.rev == "00" and not os.path.isfile(pathname):
@@ -866,7 +866,7 @@ def document_main(request, name, rev=None, document_html=False):
# we need to remove the extension for the globbing below to work
basename = os.path.splitext(doc.uploaded_filename)[0]
else:
- basename = "%s-%s" % (doc.canonical_name(), doc.rev)
+ basename = "%s-%s" % (doc.name, doc.rev)
pathname = os.path.join(doc.get_file_path(), basename)
@@ -1051,7 +1051,7 @@ def document_html(request, name, rev=None):
if not requested_rev and doc.type_id == "rfc": # Someone asked for /doc/html/8989
if not name.startswith('rfc'):
- return redirect('ietf.doc.views_doc.document_html', name=doc.canonical_name())
+ return redirect('ietf.doc.views_doc.document_html', name=doc.name)
if rev:
doc = doc.history_set.filter(rev=rev).first() or doc.fake_history_obj(rev)
@@ -1061,7 +1061,7 @@ def document_html(request, name, rev=None):
return document_main(
request,
- name=doc.name if requested_rev else doc.canonical_name(),
+ name=doc.name if requested_rev else doc.name,
rev=doc.rev if requested_rev or doc.type_id != "rfc" else None,
document_html=True,
)
@@ -1461,7 +1461,7 @@ def document_referenced_by(request, name):
refs=refs[:250]
else:
numdocs=None
- refs=sorted(refs,key=lambda x:(['refnorm','refinfo','refunk','refold'].index(x.relationship.slug),x.source.canonical_name()))
+ refs=sorted(refs,key=lambda x:(['refnorm','refinfo','refunk','refold'].index(x.relationship.slug),x.source.name))
return render(request, "doc/document_referenced_by.html",
dict(name=name,
doc=doc,
@@ -1768,8 +1768,8 @@ def telechat_date(request, name):
def doc_titletext(doc):
if doc.type.slug=='conflrev':
conflictdoc = doc.relateddocument_set.get(relationship__slug='conflrev').target
- return 'the conflict review of %s' % conflictdoc.canonical_name()
- return doc.canonical_name()
+ return 'the conflict review of %s' % conflictdoc.name
+ return doc.name
def edit_notify(request, name):
@@ -2008,7 +2008,7 @@ def remind_action_holders(request, name):
form = ReminderEmailForm(request.POST)
if form.is_valid():
email_remind_action_holders(request, doc, form.cleaned_data['note'])
- return redirect('ietf.doc.views_doc.document_main', name=doc.canonical_name())
+ return redirect('ietf.doc.views_doc.document_main', name=doc.name)
form = ReminderEmailForm()
return render(
diff --git a/ietf/doc/views_status_change.py b/ietf/doc/views_status_change.py
index 18c787aa4..1523dcd74 100644
--- a/ietf/doc/views_status_change.py
+++ b/ietf/doc/views_status_change.py
@@ -99,7 +99,7 @@ def change_state(request, name, option=None):
)
related_doc_info = [
dict(title=rel_doc.target.title,
- canonical_name=rel_doc.target.canonical_name(),
+ name=rel_doc.target.name,
newstatus=newstatus(rel_doc))
for rel_doc in related_docs
]
@@ -148,7 +148,7 @@ class UploadForm(forms.Form):
return get_cleaned_text_file_content(self.cleaned_data["txt"])
def save(self, doc):
- filename = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ filename = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
with io.open(filename, 'w', encoding='utf-8') as destination:
if self.cleaned_data['txt']:
destination.write(self.cleaned_data['txt'])
@@ -162,7 +162,7 @@ def submit(request, name):
login = request.user.person
- path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ path = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
not_uploaded_yet = doc.rev == "00" and not os.path.exists(path)
if not_uploaded_yet:
@@ -179,7 +179,7 @@ def submit(request, name):
events = []
e = NewRevisionDocEvent(doc=doc, by=login, type="new_revision")
- e.desc = "New version available: %s-%s.txt " % (doc.canonical_name(), doc.rev)
+ e.desc = "New version available: %s-%s.txt " % (doc.name, doc.rev)
e.rev = doc.rev
e.save()
events.append(e)
@@ -211,7 +211,7 @@ def submit(request, name):
dict(),
)
else:
- filename = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.canonical_name(), doc.rev))
+ filename = os.path.join(settings.STATUS_CHANGE_PATH, '%s-%s.txt' % (doc.name, doc.rev))
try:
with io.open(filename, 'r') as f:
init["content"] = f.read()
@@ -253,7 +253,7 @@ def edit_title(request, name):
init = { "title" : status_change.title }
form = ChangeTitleForm(initial=init)
- titletext = '%s-%s.txt' % (status_change.canonical_name(),status_change.rev)
+ titletext = '%s-%s.txt' % (status_change.name,status_change.rev)
return render(request, 'doc/change_title.html',
{'form': form,
'doc': status_change,
@@ -284,7 +284,7 @@ def edit_ad(request, name):
init = { "ad" : status_change.ad_id }
form = AdForm(initial=init)
- titletext = '%s-%s.txt' % (status_change.canonical_name(),status_change.rev)
+ titletext = '%s-%s.txt' % (status_change.name,status_change.rev)
return render(request, 'doc/change_ad.html',
{'form': form,
'doc': status_change,
@@ -399,7 +399,7 @@ def approve(request, name):
init = []
for rel in status_change.relateddocument_set.filter(relationship__slug__in=STATUSCHANGE_RELATIONS):
init.append({"announcement_text" : escape(default_approval_text(status_change,rel)),
- "label": "Announcement text for %s to %s"%(rel.target.canonical_name(),newstatus(rel)),
+ "label": "Announcement text for %s to %s"%(rel.target.name,newstatus(rel)),
})
formset = AnnouncementFormSet(initial=init)
for form in formset.forms:
@@ -574,9 +574,9 @@ def start_rfc_status_change(request, name=None):
init = {}
if name:
init['title'] = "%s to CHANGETHIS" % seed_rfc.title
- init['document_name'] = "%s-to-CHANGETHIS" % seed_rfc.canonical_name()
+ init['document_name'] = "%s-to-CHANGETHIS" % seed_rfc.name
relations={}
- relations[seed_rfc.canonical_name()]=None
+ relations[seed_rfc.name]=None
init['relations'] = relations
form = StartStatusChangeForm(initial=init)
@@ -602,7 +602,7 @@ def edit_relations(request, name):
old_relations={}
for rel in status_change.relateddocument_set.filter(relationship__slug__in=STATUSCHANGE_RELATIONS):
- old_relations[rel.target.canonical_name()]=rel.relationship.slug
+ old_relations[rel.target.name]=rel.relationship.slug
new_relations=form.cleaned_data['relations']
status_change.relateddocument_set.filter(relationship__slug__in=STATUSCHANGE_RELATIONS).delete()
for key in new_relations:
@@ -623,7 +623,7 @@ def edit_relations(request, name):
else:
relations={}
for rel in status_change.relateddocument_set.filter(relationship__slug__in=STATUSCHANGE_RELATIONS):
- relations[rel.target.canonical_name()]=rel.relationship.slug
+ relations[rel.target.name]=rel.relationship.slug
init = { "relations":relations,
}
form = EditStatusChangeForm(initial=init)
diff --git a/ietf/group/views.py b/ietf/group/views.py
index 8076f33a7..d93dfddac 100644
--- a/ietf/group/views.py
+++ b/ietf/group/views.py
@@ -770,7 +770,7 @@ def dependencies(request, acronym, group_type=None):
graph = {
"nodes": [
{
- "id": x.canonical_name(),
+ "id": x.name,
"rfc": x.get_state("draft").slug == "rfc",
"post-wg": not x.get_state("draft-iesg").slug
in ["idexists", "watching", "dead"],
@@ -788,8 +788,8 @@ def dependencies(request, acronym, group_type=None):
],
"links": [
{
- "source": x.source.canonical_name(),
- "target": x.target.canonical_name(),
+ "source": x.source.name,
+ "target": x.target.name,
"rel": "downref" if x.is_downref() else x.relationship.slug,
}
for x in links
diff --git a/ietf/iesg/views.py b/ietf/iesg/views.py
index 3038a2092..f7e354159 100644
--- a/ietf/iesg/views.py
+++ b/ietf/iesg/views.py
@@ -122,7 +122,7 @@ def agenda_json(request, date=None):
for doc in docs:
wginfo = {
- 'docname': doc.canonical_name(),
+ 'docname': doc.name,
'rev': doc.rev,
'wgname': doc.group.name,
'acronym': doc.group.acronym,
@@ -137,7 +137,7 @@ def agenda_json(request, date=None):
for doc in docs:
docinfo = {
- 'docname':doc.canonical_name(),
+ 'docname':doc.name,
'title':doc.title,
'ad':doc.ad.name if doc.ad else None,
}
@@ -173,7 +173,7 @@ def agenda_json(request, date=None):
elif doc.type_id == 'conflrev':
docinfo['rev'] = doc.rev
td = doc.relateddocument_set.get(relationship__slug='conflrev').target
- docinfo['target-docname'] = td.canonical_name()
+ docinfo['target-docname'] = td.name
docinfo['target-title'] = td.title
docinfo['target-rev'] = td.rev
docinfo['intended-std-level'] = str(td.intended_std_level)
diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py
index 9609fad3d..33e37c532 100644
--- a/ietf/meeting/tests_views.py
+++ b/ietf/meeting/tests_views.py
@@ -550,7 +550,7 @@ class MeetingTests(BaseMeetingTestCase):
if material.type_id == 'draft':
expected_url = urlreverse(
'ietf.doc.views_doc.document_main',
- kwargs={'name': material.canonical_name()},
+ kwargs={'name': material.name},
)
else:
expected_url = material.get_href(meeting)
@@ -561,7 +561,7 @@ class MeetingTests(BaseMeetingTestCase):
if material.type_id == 'draft':
expected_url = urlreverse(
'ietf.doc.views_doc.document_main',
- kwargs={'name': material.canonical_name()},
+ kwargs={'name': material.name},
)
else:
expected_url = material.get_href(meeting)
@@ -7773,7 +7773,7 @@ class ProceedingsTests(BaseMeetingTestCase):
if material.type_id == 'draft':
expected_url = urlreverse(
'ietf.doc.views_doc.document_main',
- kwargs={'name': material.canonical_name()},
+ kwargs={'name': material.name},
)
else:
expected_url = material.get_href(meeting)
@@ -7784,7 +7784,7 @@ class ProceedingsTests(BaseMeetingTestCase):
if material.type_id == 'draft':
expected_url = urlreverse(
'ietf.doc.views_doc.document_main',
- kwargs={'name': material.canonical_name()},
+ kwargs={'name': material.name},
)
else:
expected_url = material.get_href(meeting)
diff --git a/ietf/person/models.py b/ietf/person/models.py
index 22c63d4a0..87a33704b 100644
--- a/ietf/person/models.py
+++ b/ietf/person/models.py
@@ -191,7 +191,7 @@ class Person(models.Model):
def rfcs(self):
from ietf.doc.models import Document
rfcs = list(Document.objects.filter(documentauthor__person=self, type='draft', states__slug='rfc'))
- rfcs.sort(key=lambda d: d.canonical_name() )
+ rfcs.sort(key=lambda d: d.name )
return rfcs
def active_drafts(self):
diff --git a/ietf/secr/templates/telechat/doc.html b/ietf/secr/templates/telechat/doc.html
index 9ed8693df..7891c1b1e 100644
--- a/ietf/secr/templates/telechat/doc.html
+++ b/ietf/secr/templates/telechat/doc.html
@@ -85,7 +85,7 @@
{% if downrefs %}
Downward References
{% for ref in downrefs %}
- Add {{ref.target.canonical_name}}
+
Add {{ref.target.name}}
({{ref.target.std_level}} - {{ref.target.stream.desc}})
to downref registry.
{% if not ref.target.std_level %}
diff --git a/ietf/templates/doc/ballot/approvaltext.html b/ietf/templates/doc/ballot/approvaltext.html
index cc47c1715..3cb632b8f 100644
--- a/ietf/templates/doc/ballot/approvaltext.html
+++ b/ietf/templates/doc/ballot/approvaltext.html
@@ -29,7 +29,7 @@
href="{% url 'ietf.doc.views_ballot.approve_ballot' name=doc.name %}">Approve ballot
{% endif %}
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/approve_ballot.html b/ietf/templates/doc/ballot/approve_ballot.html
index ff8ab0894..30dd05fa4 100644
--- a/ietf/templates/doc/ballot/approve_ballot.html
+++ b/ietf/templates/doc/ballot/approve_ballot.html
@@ -21,7 +21,7 @@
Email RFC Editor (DNP) & close ballot"
{% endif %}
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/approve_downrefs.html b/ietf/templates/doc/ballot/approve_downrefs.html
index 6dea10a33..ad528c67b 100644
--- a/ietf/templates/doc/ballot/approve_downrefs.html
+++ b/ietf/templates/doc/ballot/approve_downrefs.html
@@ -12,16 +12,16 @@
The ballot for
- {{ doc }}
+ {{ doc }}
was just approved.
{% if not downrefs_to_rfc %}
No downward references for
- {{ doc }}
+ {{ doc }}
Back
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">Back
{% else %}
Add downward references to RFCs to the DOWNREF registry, if they were identified in the IETF Last Call and approved by the Sponsoring Area Director.
@@ -41,7 +41,7 @@
{% csrf_token %}
{% bootstrap_form approve_downrefs_form %}
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Add no DOWNREF entries
Add checked DOWNREF entries
diff --git a/ietf/templates/doc/ballot/ballot_issued.html b/ietf/templates/doc/ballot/ballot_issued.html
index baf428ee6..dfa03896e 100644
--- a/ietf/templates/doc/ballot/ballot_issued.html
+++ b/ietf/templates/doc/ballot/ballot_issued.html
@@ -11,7 +11,7 @@
Ballot for
- {{ doc }}
+ {{ doc }}
has been sent out.
{% if doc.telechat_date %}
@@ -24,5 +24,5 @@
{% endif %}
Back
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">Back
{% endblock %}
diff --git a/ietf/templates/doc/ballot/clear_ballot.html b/ietf/templates/doc/ballot/clear_ballot.html
index 1d5bc4600..09e7dfef1 100644
--- a/ietf/templates/doc/ballot/clear_ballot.html
+++ b/ietf/templates/doc/ballot/clear_ballot.html
@@ -14,14 +14,14 @@
{% csrf_token %}
Clear the ballot for
- {{ doc }} ?
+ {{ doc }} ?
This will clear all ballot positions and discuss entries.
Clear
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/defer_ballot.html b/ietf/templates/doc/ballot/defer_ballot.html
index 43fdc82a5..ae7099e9e 100644
--- a/ietf/templates/doc/ballot/defer_ballot.html
+++ b/ietf/templates/doc/ballot/defer_ballot.html
@@ -14,14 +14,14 @@
{% csrf_token %}
Defer the ballot for
- {{ doc }} ?
+ {{ doc }} ?
The ballot will then be put on the IESG agenda of {{ telechat_date }}.
Defer ballot
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/edit_position.html b/ietf/templates/doc/ballot/edit_position.html
index bf119236f..293c18611 100644
--- a/ietf/templates/doc/ballot/edit_position.html
+++ b/ietf/templates/doc/ballot/edit_position.html
@@ -54,7 +54,7 @@
{% endif %}
{% endif %}
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/lastcalltext.html b/ietf/templates/doc/ballot/lastcalltext.html
index c1d7bd70d..fe2b884c2 100644
--- a/ietf/templates/doc/ballot/lastcalltext.html
+++ b/ietf/templates/doc/ballot/lastcalltext.html
@@ -39,7 +39,7 @@
href="{% url 'ietf.doc.views_ballot.make_last_call' name=doc.name %}">Issue last call
{% endif %}
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/rfceditornote.html b/ietf/templates/doc/ballot/rfceditornote.html
index b4cc9dadc..8a6d57379 100644
--- a/ietf/templates/doc/ballot/rfceditornote.html
+++ b/ietf/templates/doc/ballot/rfceditornote.html
@@ -31,7 +31,7 @@
Clear
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/send_ballot_comment.html b/ietf/templates/doc/ballot/send_ballot_comment.html
index ffd2d4119..1c5f52185 100644
--- a/ietf/templates/doc/ballot/send_ballot_comment.html
+++ b/ietf/templates/doc/ballot/send_ballot_comment.html
@@ -37,7 +37,7 @@
Send
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/undefer_ballot.html b/ietf/templates/doc/ballot/undefer_ballot.html
index da74326a2..4e8669816 100644
--- a/ietf/templates/doc/ballot/undefer_ballot.html
+++ b/ietf/templates/doc/ballot/undefer_ballot.html
@@ -19,7 +19,7 @@
Undefer ballot
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/ballot/writeupnotes.html b/ietf/templates/doc/ballot/writeupnotes.html
index dbbd04dc2..e3774be15 100644
--- a/ietf/templates/doc/ballot/writeupnotes.html
+++ b/ietf/templates/doc/ballot/writeupnotes.html
@@ -32,7 +32,7 @@
Save & {% if ballot_issued %}re-{% endif %}issue ballot
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/bofreq/change_editors.html b/ietf/templates/doc/bofreq/change_editors.html
index 98c4ddb3a..0c30cdecb 100644
--- a/ietf/templates/doc/bofreq/change_editors.html
+++ b/ietf/templates/doc/bofreq/change_editors.html
@@ -16,7 +16,7 @@
{% bootstrap_form form %}
Submit
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/bofreq/change_responsible.html b/ietf/templates/doc/bofreq/change_responsible.html
index aabb0048e..8c51c6e1f 100644
--- a/ietf/templates/doc/bofreq/change_responsible.html
+++ b/ietf/templates/doc/bofreq/change_responsible.html
@@ -16,7 +16,7 @@
{% bootstrap_form form %}
Submit
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/change_ad.html b/ietf/templates/doc/change_ad.html
index 24e808951..9cc743757 100644
--- a/ietf/templates/doc/change_ad.html
+++ b/ietf/templates/doc/change_ad.html
@@ -15,7 +15,7 @@
{% bootstrap_form form %}
Submit
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/change_title.html b/ietf/templates/doc/change_title.html
index 25026be35..14d7956cf 100644
--- a/ietf/templates/doc/change_title.html
+++ b/ietf/templates/doc/change_title.html
@@ -15,7 +15,7 @@
{% bootstrap_form form %}
Submit
+ href="{% url "ietf.doc.views_doc.document_main" name=doc.name %}">
Back
diff --git a/ietf/templates/doc/conflict_review/approval_text.txt b/ietf/templates/doc/conflict_review/approval_text.txt
index 8e211e21c..a52ac11a7 100644
--- a/ietf/templates/doc/conflict_review/approval_text.txt
+++ b/ietf/templates/doc/conflict_review/approval_text.txt
@@ -1,9 +1,9 @@
{% load ietf_filters %}{% load mail_filters %}{% autoescape off %}From: The IESG
To: {{ to }}
Cc: {{ cc }}
-Subject: Results of IETF-conflict review for {{conflictdoc.canonical_name}}-{{conflictdoc.rev}}
+Subject: Results of IETF-conflict review for {{conflictdoc.name}}-{{conflictdoc.rev}}
-{% filter wordwrap:78 %}The IESG has completed a review of {{conflictdoc.canonical_name}}-{{conflictdoc.rev}} consistent with RFC5742.
+{% filter wordwrap:78 %}The IESG has completed a review of {{conflictdoc.name}}-{{conflictdoc.rev}} consistent with RFC5742.
{% if review.get_state_slug == 'appr-reqnopub-pend' %}
The IESG recommends that '{{ conflictdoc.title }}' {{ conflictdoc.file_tag|safe }} NOT be published as {{ conflictdoc|std_level_prompt_with_article }}.
diff --git a/ietf/templates/doc/conflict_review/approve.html b/ietf/templates/doc/conflict_review/approve.html
index 5283587f0..ccbac9c4c 100644
--- a/ietf/templates/doc/conflict_review/approve.html
+++ b/ietf/templates/doc/conflict_review/approve.html
@@ -2,10 +2,10 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load django_bootstrap5 %}
-{% block title %}Approve {{ review.canonical_name }}{% endblock %}
+{% block title %}Approve {{ review.name }}{% endblock %}
{% block content %}
{% origin %}
- Approve {{ review.canonical_name }}
+ Approve {{ review.name }}
diff --git a/ietf/templates/doc/document_charter.html b/ietf/templates/doc/document_charter.html
index df5d702e4..cdc0bbdc3 100644
--- a/ietf/templates/doc/document_charter.html
+++ b/ietf/templates/doc/document_charter.html
@@ -227,7 +227,7 @@
{% if doc.rev != "" %}