Skip to content

Commit b56b8de

Browse files
committed
Fix some bugs in displaying meeting-related materials in the new material
support under /doc/ - Legacy-Id: 7838
1 parent 2a1f902 commit b56b8de

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,13 @@ def document_main(request, name, rev=None):
487487
# disallow editing meeting-related stuff through this
488488
# interface for the time being
489489
can_manage_material = False
490+
basename = doc.canonical_name() # meeting materials are unversioned at the moment
491+
if doc.external_url:
492+
# we need to remove the extension for the globbing below to work
493+
basename = os.path.splitext(doc.external_url)[0]
494+
else:
495+
basename = "%s-%s" % (doc.canonical_name(), doc.rev)
490496

491-
basename = "%s-%s" % (doc.canonical_name(), doc.rev)
492497
pathname = os.path.join(doc.get_file_path(), basename)
493498

494499
content = None
@@ -497,10 +502,12 @@ def document_main(request, name, rev=None):
497502
for g in globs:
498503
extension = os.path.splitext(g)[1]
499504
t = os.path.splitext(g)[1].lstrip(".")
500-
url = doc.href() + extension
505+
url = doc.href()
506+
if not url.endswith("/") and not url.endswith(extension):
507+
url += extension
501508

502509
if extension == ".txt":
503-
content = get_document_content(basename, pathname, split=False)
510+
content = get_document_content(basename, pathname + extension, split=False)
504511
t = "plain text"
505512

506513
other_types.append((t, url))

0 commit comments

Comments
 (0)