File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copyright The IETF Trust 2020, All Rights Reserved
2+ # -*- coding: utf-8 -*-
3+ # Generated by Django 1.11.20 on 2019-05-21 14:27
4+
5+
6+ from __future__ import absolute_import , print_function , unicode_literals
7+
8+ import re
9+
10+ from django .conf import settings
11+ from django .db import migrations
12+
13+
14+ def forward (apps , schema_editor ):
15+
16+ Document = apps .get_model ('doc' , 'Document' )
17+
18+ print ('' )
19+ for d in Document .objects .filter (external_url__contains = "/b'" ):
20+ match = re .search ("^(%s/arch/msg/[^/]+/)b'([^']+)'$" % settings .MAILING_LIST_ARCHIVE_URL , d .external_url )
21+ if match :
22+ d .external_url = "%s%s" % (match .group (1 ), match .group (2 ))
23+ d .save ()
24+ print ('Fixed url #%s: %s' % (d .id , d .external_url ))
25+
26+ def reverse (apps , schema_editor ):
27+ pass
28+
29+ class Migration (migrations .Migration ):
30+
31+ dependencies = [
32+ ('doc' , '0029_add_ipr_event_types' ),
33+ ]
34+
35+ operations = [
36+ migrations .RunPython (forward , reverse ),
37+ ]
You can’t perform that action at this time.
0 commit comments