Skip to content

Commit 3baea05

Browse files
committed
Use the id-archive wherever we had been using the id-repository. Fixes ietf-tools#3080. Commit ready for merge.
- Legacy-Id: 18550
1 parent 6ee63c8 commit 3baea05

10 files changed

Lines changed: 21 additions & 17 deletions

ietf/doc/redirect_drafts_urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright The IETF Trust 2007, All Rights Reserved
22

3+
from django.conf import settings
34
from django.views.generic import RedirectView
45
from django.http import HttpResponsePermanentRedirect
56
from django.shortcuts import get_object_or_404
@@ -17,5 +18,5 @@
1718
url(r'^(?P<name>[^/]+)/(related/)?$', RedirectView.as_view(url='/doc/%(name)s/', permanent=True)),
1819
url(r'^wgid/(?P<id>\d+)/$', lambda request, id: HttpResponsePermanentRedirect("/wg/%s/" % get_object_or_404(Group, id=id).acronym)),
1920
url(r'^wg/(?P<acronym>[^/]+)/$', RedirectView.as_view(url='/wg/%(acronym)s/', permanent=True)),
20-
url(r'^all_id(?:_txt)?.html$', RedirectView.as_view(url='https://www.ietf.org/id/all_id.txt', permanent=True)),
21+
url(r'^all_id(?:_txt)?.html$', RedirectView.as_view(url='%s/all_id.txt'%settings.IETF_ID_ARCHIVE_URL, permanent=True)),
2122
]

ietf/doc/views_doc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ def document_main(request, name, rev=None):
248248
possible_types = settings.IDSUBMIT_FILE_TYPES
249249
found_types = [t for t in possible_types if os.path.exists(base_path + t)]
250250

251-
if not snapshot and doc.get_state_slug() == "active":
252-
base = settings.IETF_ID_URL
253-
else:
254-
base = settings.IETF_ID_ARCHIVE_URL
251+
# if not snapshot and doc.get_state_slug() == "active":
252+
# base = settings.IETF_ID_URL
253+
# else:
254+
# base = settings.IETF_ID_ARCHIVE_URL
255+
base = settings.IETF_ID_ARCHIVE_URL
255256

256257
file_urls = []
257258
for t in found_types:

ietf/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
]
141141

142142
IETF_HOST_URL = 'https://www.ietf.org/'
143-
IETF_ID_URL = IETF_HOST_URL + 'id/'
143+
IETF_ID_URL = IETF_HOST_URL + 'id/' # currently unused
144144
IETF_ID_ARCHIVE_URL = IETF_HOST_URL + 'archive/id/'
145145
IETF_AUDIO_URL = IETF_HOST_URL + 'audio/'
146146

ietf/submit/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright The IETF Trust 2011-2020, All Rights Reserved
22
from django.urls import reverse as urlreverse
33
from django.contrib import admin
4+
from django.conf import settings
45

56

67
from ietf.submit.models import Preapproval, Submission, SubmissionEvent, SubmissionCheck, SubmissionEmailEvent
@@ -21,7 +22,7 @@ def status_link(self, instance):
2122

2223
def draft_link(self, instance):
2324
if instance.state_id == "posted":
24-
return '<a href="https://www.ietf.org/id/%s-%s.txt">%s</a>' % (instance.name, instance.rev, instance.name)
25+
return '<a href="%s/%s-%s.txt">%s</a>' % (settings.IETF_ID_ARCHIVE_URL,instance.name, instance.rev, instance.name)
2526
else:
2627
return instance.name
2728
draft_link.allow_tags = True # type: ignore # https://github.com/python/mypy/issues/2087

ietf/submit/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def submit_new_wg(self, formats):
351351
self.assertIn("New Version Notification",outbox[-2]["Subject"])
352352
self.assertIn(name, get_payload_text(outbox[-2]))
353353
self.assertIn("mars", get_payload_text(outbox[-2]))
354+
self.assertIn(settings.IETF_ID_ARCHIVE_URL, get_payload_text(outbox[-2]))
354355
# Check "Review of suggested possible replacements for..." mail
355356
self.assertIn("review", outbox[-1]["Subject"].lower())
356357
self.assertIn(name, get_payload_text(outbox[-1]))

ietf/templates/doc/index_all_drafts.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ <h1>Index of all Internet-Drafts and RFCs</h1>
1818

1919
<p>In addition, the following files are available for download:</p>
2020
<ul>
21-
<li><a href="https://www.ietf.org/id/1id-index.txt">Active Internet-Drafts (text)</a></li>
22-
<li><a href="https://www.ietf.org/id/1id-abstracts.txt">Active Internet-Drafts with abstracts (text)</a></li>
23-
<li><a href="https://www.ietf.org/id/all_id2.txt">All Internet-Drafts (tab-separated)</a>, <a href="https://www.ietf.org/id/all_id.txt">older version (with fewer fields)</a></li>
21+
<li><a href="{{settings.IETF_ID_ARCHIVE_URL}}1id-index.txt">Active Internet-Drafts (text)</a></li>
22+
<li><a href="{{settings.IETF_ID_ARCHIVE_URL}}1id-abstracts.txt">Active Internet-Drafts with abstracts (text)</a></li>
23+
<li><a href="{{settings.IETF_ID_ARCHIVE_URL}}all_id2.txt">All Internet-Drafts (tab-separated)</a>, <a href="{{settings.IETF_ID_ARCHIVE_URL}}all_id.txt">older version (with fewer fields)</a></li>
2424
<li><a href="https://www.rfc-editor.org/rfc/rfc-index.txt">All RFCs (text)</a></li>
2525
<li><a href="https://www.rfc-editor.org/rfc/rfc-index.xml">All RFCs (XML)</a></li>
2626
</ul>

ietf/templates/iesg/agenda_conflict_doc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<dt>{{ conflictdoc.stream }} {{ conflictdoc.intended_std_level }}</dt>
1919
<dd>
20-
<a href="https://www.ietf.org/id/{{ conflictdoc.name }}-{{ conflictdoc.rev }}.txt">
20+
<a href="{{settings.IETF_ID_ARCHIVE_URL}}{{ conflictdoc.name }}-{{ conflictdoc.rev }}.txt">
2121
<span class="fa fa-file"></span>
2222
</a>
2323
<a href="{% url "ietf.doc.views_doc.document_main" name=conflictdoc.name %}">{{ conflictdoc.name }}</a>

ietf/templates/submit/announce_new_version.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% autoescape off %}
22
A new version (-{{ submission.rev }}) has been submitted for {{ submission.name }}:
3-
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.txt{% if submission.xml_version == "3" %}
4-
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% endif %}
3+
{{settings.IETF_ID_ARCHIVE_URL}}{{ submission.name }}-{{ submission.rev }}.txt{% if submission.xml_version == "3" %}
4+
{{settings.IETF_ID_ARCHIVE_URL}}{{ submission.name }}-{{ submission.rev }}.html{% endif %}
55
{% if msg %}
66
{{ msg|striptags }}
77
{% endif %}

ietf/templates/submit/announce_to_authors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Title: {{ submission.title }}
99
Document date: {{ submission.document_date|date:"Y-m-d" }}
1010
Group: {{ group }}
1111
Pages: {{ submission.pages }}
12-
URL: https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.txt
12+
URL: {{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.txt
1313
Status: https://datatracker.ietf.org/doc/{{ submission.name }}/{% if submission.xml_version == "3" %}
14-
Html: https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% else %}
14+
Html: {{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.html{% else %}
1515
Htmlized: https://datatracker.ietf.org/doc/html/{{ submission.name }}{% endif %}
1616
Htmlized: https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }}
1717
{% if submission.rev != "00" %}Diff: {{rfcdiff_base_url}}?url2={{ submission.name }}-{{ submission.rev }}{% endif %}

ietf/templates/submit/announce_to_lists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Abstract:
1515
The IETF datatracker status page for this draft is:
1616
https://datatracker.ietf.org/doc/{{ submission.name }}/
1717
{% if submission.xml_version == "3" %}
18-
There is also a HTML versions available at:
19-
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% else %}
18+
There is also a HTML version available at:
19+
{{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.html{% else %}
2020
There are also htmlized versions available at:
2121
https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }}
2222
https://datatracker.ietf.org/doc/html/{{ submission.name }}-{{ submission.rev }}{% endif %}

0 commit comments

Comments
 (0)