From 5def83ef16e041cee4e38c0db2d6039f5c6bd0f4 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 1 May 2019 21:24:41 +0000 Subject: [PATCH] Removed links to the old MHonArc mail archives, and related view. - Legacy-Id: 16179 --- ietf/group/tests.py | 26 ---------------------- ietf/group/urls.py | 1 - ietf/group/utils.py | 5 +---- ietf/group/views.py | 20 ----------------- ietf/templates/group/derived_archives.html | 26 ---------------------- 5 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 ietf/templates/group/derived_archives.html diff --git a/ietf/group/tests.py b/ietf/group/tests.py index 3f2d03a83..752eb2584 100644 --- a/ietf/group/tests.py +++ b/ietf/group/tests.py @@ -1,8 +1,6 @@ import os from unittest import skipIf -from pyquery import PyQuery - from django.conf import settings from django.urls import reverse as urlreverse from django.db.models import Q @@ -152,27 +150,3 @@ class GroupRoleEmailTests(TestCase): for item in emails: self.assertIn('@', item) -class GroupDerivedArchiveTests(TestCase): - - def test_group_with_mailarch(self): - group = GroupFactory() - group.list_archive = 'https://mailarchive.ietf.org/arch/browse/%s/'%group.acronym - group.save() - url = urlreverse("ietf.group.views.derived_archives",kwargs=dict(acronym=group.acronym)) - r = self.client.get(url) - self.assertEqual(r.status_code, 200) - q = PyQuery(r.content) - self.assertEqual(url, q('.nav-tabs .active a')[0].attrib['href']) - self.assertTrue(group.list_archive in unicontent(r)) - self.assertTrue('web/%s/current'%group.acronym in unicontent(r)) - - def test_group_without_mailarch(self): - group = GroupFactory() - group.list_archive = 'https://alienarchive.example.com' - group.save() - url = urlreverse("ietf.group.views.derived_archives",kwargs=dict(acronym=group.acronym)) - r = self.client.get(url) - self.assertEqual(r.status_code, 200) - q = PyQuery(r.content) - self.assertFalse(q('.nav-tabs .active')) - self.assertTrue(group.list_archive in unicontent(r)) diff --git a/ietf/group/urls.py b/ietf/group/urls.py index 3a9a70235..20af6f73b 100644 --- a/ietf/group/urls.py +++ b/ietf/group/urls.py @@ -38,7 +38,6 @@ info_detail_urls = [ url(r'^materials/$', views.materials), url(r'^materials/new/$', material_views.choose_material_type), url(r'^materials/new/(?P[\w-]+)/$', material_views.edit_material, { 'action': "new" }, 'ietf.doc.views_material.edit_material'), - url(r'^archives/$', views.derived_archives), url(r'^photos/$', views.group_photos), url(r'^reviews/$', views.review_requests), url(r'^reviews/manage/(?Punassigned)/$', views.manage_review_requests), diff --git a/ietf/group/utils.py b/ietf/group/utils.py index ca0f27f0d..2e5f82116 100644 --- a/ietf/group/utils.py +++ b/ietf/group/utils.py @@ -195,10 +195,7 @@ def construct_group_menu_context(request, group, selected, group_type, others): entries.append(("Photos", urlreverse("ietf.group.views.group_photos", kwargs=kwargs))) entries.append(("Email expansions", urlreverse("ietf.group.views.email", kwargs=kwargs))) if group.list_archive.startswith("http:") or group.list_archive.startswith("https:") or group.list_archive.startswith("ftp:"): - if 'mailarchive.ietf.org' in group.list_archive: - entries.append(("List archive", urlreverse("ietf.group.views.derived_archives", kwargs=kwargs))) - else: - entries.append((mark_safe("List archive »"), group.list_archive)) + entries.append((mark_safe("List archive »"), group.list_archive)) if group.has_tools_page(): entries.append((mark_safe("Tools »"), "https://tools.ietf.org/%s/%s/" % (group.type_id, group.acronym))) diff --git a/ietf/group/views.py b/ietf/group/views.py index 7163fa724..bdfd95d8a 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -757,26 +757,6 @@ def meetings(request, acronym=None, group_type=None): 'can_edit':can_edit, })) -def derived_archives(request, acronym=None, group_type=None): - group = get_group_or_404(acronym,group_type) if acronym else None - - list_acronym = None - - m = re.search('mailarchive.ietf.org/arch/search/?\?email_list=([-\w]+)\Z',group.list_archive) - if m: - list_acronym=m.group(1) - - if not list_acronym: - m = re.search('mailarchive.ietf.org/arch/browse/([-\w]+)/?\Z',group.list_archive) - if m: - list_acronym=m.group(1) - - return render(request, 'group/derived_archives.html', - construct_group_menu_context(request, group, "list archive", group_type, { - 'group':group, - 'list_acronym':list_acronym, - })) - def chair_photos(request, group_type=None): roles = sorted(Role.objects.filter(group__type=group_type, group__state='active', name_id='chair'),key=lambda x: x.person.last_name()+x.person.name+x.group.acronym) for role in roles: diff --git a/ietf/templates/group/derived_archives.html b/ietf/templates/group/derived_archives.html deleted file mode 100644 index 63895fe98..000000000 --- a/ietf/templates/group/derived_archives.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "group/group_base.html" %} -{# Copyright The IETF Trust 2016, All Rights Reserved #} -{% load origin %} - -{% block title %}Archives{% if group %} for {{group.acronym}}{% endif %}{% endblock %} - -{% block group_content %} -{% origin %} - -{% if list_acronym %} - -
-Mailarchive{{group.list_archive}} -
- - - -{% else %} - -{% endif %} - -{% endblock %}