Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ietf/group/migrations/0004_modern_list_archive.py
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion ietf/templates/doc/document_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
{% endfor %}
{% if doc.group and doc.group.list_archive %}
{% if doc.group.list_archive|startswith:settings.MAILING_LIST_ARCHIVE_URL %}
<a href="{{ doc.group.list_archive }}?q={{ doc.name }}">
<a href="{{ doc.group.list_archive }}?q={{ doc.name }}{% if doc.came_from_draft %} OR %22{{ doc.came_from_draft.name }}%22{% endif%}">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not URL encode spaces around OR as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you find an ecosystem where it's actually necessary? (escaping the double-quotes was mostly a quick way to construct a string that django wouldn't mangle on the way out).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I requested a change just to avoid confusion. It's not apparent that spaces around OR are important.

Mailing list discussion
</a>
{% elif doc.group.list_archive|is_valid_url %}
Expand Down