Use the id-archive wherever we had been using the id-repository. Fixes #3080. Commit ready for merge.

- Legacy-Id: 18550
This commit is contained in:
Robert Sparks 2020-10-02 14:13:17 +00:00
parent 6ee63c8a0a
commit 3baea05e6d
10 changed files with 21 additions and 17 deletions

View file

@ -1,5 +1,6 @@
# Copyright The IETF Trust 2007, All Rights Reserved # Copyright The IETF Trust 2007, All Rights Reserved
from django.conf import settings
from django.views.generic import RedirectView from django.views.generic import RedirectView
from django.http import HttpResponsePermanentRedirect from django.http import HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
@ -17,5 +18,5 @@ urlpatterns = [
url(r'^(?P<name>[^/]+)/(related/)?$', RedirectView.as_view(url='/doc/%(name)s/', permanent=True)), url(r'^(?P<name>[^/]+)/(related/)?$', RedirectView.as_view(url='/doc/%(name)s/', permanent=True)),
url(r'^wgid/(?P<id>\d+)/$', lambda request, id: HttpResponsePermanentRedirect("/wg/%s/" % get_object_or_404(Group, id=id).acronym)), url(r'^wgid/(?P<id>\d+)/$', lambda request, id: HttpResponsePermanentRedirect("/wg/%s/" % get_object_or_404(Group, id=id).acronym)),
url(r'^wg/(?P<acronym>[^/]+)/$', RedirectView.as_view(url='/wg/%(acronym)s/', permanent=True)), url(r'^wg/(?P<acronym>[^/]+)/$', RedirectView.as_view(url='/wg/%(acronym)s/', permanent=True)),
url(r'^all_id(?:_txt)?.html$', RedirectView.as_view(url='https://www.ietf.org/id/all_id.txt', permanent=True)), url(r'^all_id(?:_txt)?.html$', RedirectView.as_view(url='%s/all_id.txt'%settings.IETF_ID_ARCHIVE_URL, permanent=True)),
] ]

View file

@ -248,10 +248,11 @@ def document_main(request, name, rev=None):
possible_types = settings.IDSUBMIT_FILE_TYPES possible_types = settings.IDSUBMIT_FILE_TYPES
found_types = [t for t in possible_types if os.path.exists(base_path + t)] found_types = [t for t in possible_types if os.path.exists(base_path + t)]
if not snapshot and doc.get_state_slug() == "active": # if not snapshot and doc.get_state_slug() == "active":
base = settings.IETF_ID_URL # base = settings.IETF_ID_URL
else: # else:
base = settings.IETF_ID_ARCHIVE_URL # base = settings.IETF_ID_ARCHIVE_URL
base = settings.IETF_ID_ARCHIVE_URL
file_urls = [] file_urls = []
for t in found_types: for t in found_types:

View file

@ -140,7 +140,7 @@ OLD_PHOTO_DIRS = [
] ]
IETF_HOST_URL = 'https://www.ietf.org/' IETF_HOST_URL = 'https://www.ietf.org/'
IETF_ID_URL = IETF_HOST_URL + 'id/' IETF_ID_URL = IETF_HOST_URL + 'id/' # currently unused
IETF_ID_ARCHIVE_URL = IETF_HOST_URL + 'archive/id/' IETF_ID_ARCHIVE_URL = IETF_HOST_URL + 'archive/id/'
IETF_AUDIO_URL = IETF_HOST_URL + 'audio/' IETF_AUDIO_URL = IETF_HOST_URL + 'audio/'

View file

@ -1,6 +1,7 @@
# Copyright The IETF Trust 2011-2020, All Rights Reserved # Copyright The IETF Trust 2011-2020, All Rights Reserved
from django.urls import reverse as urlreverse from django.urls import reverse as urlreverse
from django.contrib import admin from django.contrib import admin
from django.conf import settings
from ietf.submit.models import Preapproval, Submission, SubmissionEvent, SubmissionCheck, SubmissionEmailEvent from ietf.submit.models import Preapproval, Submission, SubmissionEvent, SubmissionCheck, SubmissionEmailEvent
@ -21,7 +22,7 @@ class SubmissionAdmin(admin.ModelAdmin):
def draft_link(self, instance): def draft_link(self, instance):
if instance.state_id == "posted": if instance.state_id == "posted":
return '<a href="https://www.ietf.org/id/%s-%s.txt">%s</a>' % (instance.name, instance.rev, instance.name) return '<a href="%s/%s-%s.txt">%s</a>' % (settings.IETF_ID_ARCHIVE_URL,instance.name, instance.rev, instance.name)
else: else:
return instance.name return instance.name
draft_link.allow_tags = True # type: ignore # https://github.com/python/mypy/issues/2087 draft_link.allow_tags = True # type: ignore # https://github.com/python/mypy/issues/2087

View file

@ -351,6 +351,7 @@ class SubmitTests(TestCase):
self.assertIn("New Version Notification",outbox[-2]["Subject"]) self.assertIn("New Version Notification",outbox[-2]["Subject"])
self.assertIn(name, get_payload_text(outbox[-2])) self.assertIn(name, get_payload_text(outbox[-2]))
self.assertIn("mars", get_payload_text(outbox[-2])) self.assertIn("mars", get_payload_text(outbox[-2]))
self.assertIn(settings.IETF_ID_ARCHIVE_URL, get_payload_text(outbox[-2]))
# Check "Review of suggested possible replacements for..." mail # Check "Review of suggested possible replacements for..." mail
self.assertIn("review", outbox[-1]["Subject"].lower()) self.assertIn("review", outbox[-1]["Subject"].lower())
self.assertIn(name, get_payload_text(outbox[-1])) self.assertIn(name, get_payload_text(outbox[-1]))

View file

@ -18,9 +18,9 @@
<p>In addition, the following files are available for download:</p> <p>In addition, the following files are available for download:</p>
<ul> <ul>
<li><a href="https://www.ietf.org/id/1id-index.txt">Active Internet-Drafts (text)</a></li> <li><a href="{{settings.IETF_ID_ARCHIVE_URL}}1id-index.txt">Active Internet-Drafts (text)</a></li>
<li><a href="https://www.ietf.org/id/1id-abstracts.txt">Active Internet-Drafts with abstracts (text)</a></li> <li><a href="{{settings.IETF_ID_ARCHIVE_URL}}1id-abstracts.txt">Active Internet-Drafts with abstracts (text)</a></li>
<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> <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>
<li><a href="https://www.rfc-editor.org/rfc/rfc-index.txt">All RFCs (text)</a></li> <li><a href="https://www.rfc-editor.org/rfc/rfc-index.txt">All RFCs (text)</a></li>
<li><a href="https://www.rfc-editor.org/rfc/rfc-index.xml">All RFCs (XML)</a></li> <li><a href="https://www.rfc-editor.org/rfc/rfc-index.xml">All RFCs (XML)</a></li>
</ul> </ul>

View file

@ -17,7 +17,7 @@
<dt>{{ conflictdoc.stream }} {{ conflictdoc.intended_std_level }}</dt> <dt>{{ conflictdoc.stream }} {{ conflictdoc.intended_std_level }}</dt>
<dd> <dd>
<a href="https://www.ietf.org/id/{{ conflictdoc.name }}-{{ conflictdoc.rev }}.txt"> <a href="{{settings.IETF_ID_ARCHIVE_URL}}{{ conflictdoc.name }}-{{ conflictdoc.rev }}.txt">
<span class="fa fa-file"></span> <span class="fa fa-file"></span>
</a> </a>
<a href="{% url "ietf.doc.views_doc.document_main" name=conflictdoc.name %}">{{ conflictdoc.name }}</a> <a href="{% url "ietf.doc.views_doc.document_main" name=conflictdoc.name %}">{{ conflictdoc.name }}</a>

View file

@ -1,7 +1,7 @@
{% autoescape off %} {% autoescape off %}
A new version (-{{ submission.rev }}) has been submitted for {{ submission.name }}: A new version (-{{ submission.rev }}) has been submitted for {{ submission.name }}:
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.txt{% if submission.xml_version == "3" %} {{settings.IETF_ID_ARCHIVE_URL}}{{ submission.name }}-{{ submission.rev }}.txt{% if submission.xml_version == "3" %}
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% endif %} {{settings.IETF_ID_ARCHIVE_URL}}{{ submission.name }}-{{ submission.rev }}.html{% endif %}
{% if msg %} {% if msg %}
{{ msg|striptags }} {{ msg|striptags }}
{% endif %} {% endif %}

View file

@ -9,9 +9,9 @@ Title: {{ submission.title }}
Document date: {{ submission.document_date|date:"Y-m-d" }} Document date: {{ submission.document_date|date:"Y-m-d" }}
Group: {{ group }} Group: {{ group }}
Pages: {{ submission.pages }} Pages: {{ submission.pages }}
URL: https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.txt URL: {{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.txt
Status: https://datatracker.ietf.org/doc/{{ submission.name }}/{% if submission.xml_version == "3" %} Status: https://datatracker.ietf.org/doc/{{ submission.name }}/{% if submission.xml_version == "3" %}
Html: https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% else %} Html: {{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.html{% else %}
Htmlized: https://datatracker.ietf.org/doc/html/{{ submission.name }}{% endif %} Htmlized: https://datatracker.ietf.org/doc/html/{{ submission.name }}{% endif %}
Htmlized: https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }} Htmlized: https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }}
{% if submission.rev != "00" %}Diff: {{rfcdiff_base_url}}?url2={{ submission.name }}-{{ submission.rev }}{% endif %} {% if submission.rev != "00" %}Diff: {{rfcdiff_base_url}}?url2={{ submission.name }}-{{ submission.rev }}{% endif %}

View file

@ -15,8 +15,8 @@ Abstract:
The IETF datatracker status page for this draft is: The IETF datatracker status page for this draft is:
https://datatracker.ietf.org/doc/{{ submission.name }}/ https://datatracker.ietf.org/doc/{{ submission.name }}/
{% if submission.xml_version == "3" %} {% if submission.xml_version == "3" %}
There is also a HTML versions available at: There is also a HTML version available at:
https://www.ietf.org/id/{{ submission.name }}-{{ submission.rev }}.html{% else %} {{ settings.IETF_ID_ARCHIVE_URL }}{{ submission.name }}-{{ submission.rev }}.html{% else %}
There are also htmlized versions available at: There are also htmlized versions available at:
https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }} https://tools.ietf.org/html/{{ submission.name }}-{{ submission.rev }}
https://datatracker.ietf.org/doc/html/{{ submission.name }}-{{ submission.rev }}{% endif %} https://datatracker.ietf.org/doc/html/{{ submission.name }}-{{ submission.rev }}{% endif %}