diff --git a/ietf/group/migrations/0004_modern_list_archive.py b/ietf/group/migrations/0004_modern_list_archive.py new file mode 100644 index 0000000000..91c2fd23e2 --- /dev/null +++ b/ietf/group/migrations/0004_modern_list_archive.py @@ -0,0 +1,24 @@ +# Copyright The IETF Trust 2023, All Rights Reserved + +from django.conf import settings +from django.db import migrations +from django.db.models import Value +from django.db.models.functions import Replace + + +def forward(apps, schema_editor): + Group = apps.get_model("group", "Group") + old_pattern = f"{settings.MAILING_LIST_ARCHIVE_URL}/arch/search/?email_list=" + new_pattern = f"{settings.MAILING_LIST_ARCHIVE_URL}/arch/browse/" + + Group.objects.filter(list_archive__startswith=old_pattern).update( + list_archive=Replace("list_archive", Value(old_pattern), Value(new_pattern)) + ) + + +class Migration(migrations.Migration): + dependencies = [ + ("group", "0003_iabworkshops"), + ] + + operations = [migrations.RunPython(forward)] diff --git a/ietf/templates/doc/document_info.html b/ietf/templates/doc/document_info.html index 21591564b8..e30656e165 100644 --- a/ietf/templates/doc/document_info.html +++ b/ietf/templates/doc/document_info.html @@ -431,7 +431,7 @@ {% endfor %} {% if doc.group and doc.group.list_archive %} {% if doc.group.list_archive|startswith:settings.MAILING_LIST_ARCHIVE_URL %} - + Mailing list discussion {% elif doc.group.list_archive|is_valid_url %}