|
| 1 | +# Copyright The IETF Trust 2019-2021, All Rights Reserved |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | + |
| 4 | +from django.db import migrations |
| 5 | + |
| 6 | + |
| 7 | +def forward(apps, schema_editor): |
| 8 | + # Change the StreamName descriptions to match what appears in modern RFCs |
| 9 | + StreamName = apps.get_model('name', 'StreamName') |
| 10 | + for streamName in StreamName.objects.all(): |
| 11 | + if streamName.name == "IETF": |
| 12 | + streamName.desc = "Internent Engineering Task Force (IETF)" |
| 13 | + elif streamName.name == "IRTF": |
| 14 | + streamName.desc = "Internet Research Task Force (IRTF)" |
| 15 | + elif streamName.name == "IAB": |
| 16 | + streamName.desc = "Internet Architecture Board (IAB)" |
| 17 | + elif streamName.name == "ISE": |
| 18 | + streamName.desc = "Independent Submission" |
| 19 | + streamName.save() |
| 20 | + |
| 21 | + |
| 22 | +def reverse(apps, schema_editor): |
| 23 | + StreamName = apps.get_model('name', 'StreamName') |
| 24 | + for streamName in StreamName.objects.all(): |
| 25 | + if streamName.name == "IETF": |
| 26 | + streamName.desc = "IETF stream" |
| 27 | + elif streamName.name == "IRTF": |
| 28 | + streamName.desc = "IRTF Stream" |
| 29 | + elif streamName.name == "IAB": |
| 30 | + streamName.desc = "IAB stream" |
| 31 | + elif streamName.name == "ISE": |
| 32 | + streamName.desc = "Independent Submission Editor stream" |
| 33 | + streamName.save() |
| 34 | + |
| 35 | +class Migration(migrations.Migration): |
| 36 | + |
| 37 | + dependencies = [ |
| 38 | + ('name', '0022_add_liaison_contact_rolenames'), |
| 39 | + ] |
| 40 | + |
| 41 | + operations = [ |
| 42 | + migrations.RunPython(forward,reverse), |
| 43 | + |
| 44 | + ] |
| 45 | + |
0 commit comments