-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better archive search links for group documents (#6835)
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters