|
| 1 | +# Copyright The IETF Trust 2019, All Rights Reserved |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +from __future__ import unicode_literals |
| 4 | + |
| 5 | +from django.db import migrations |
| 6 | + |
| 7 | +def forward(apps, schema_editor): |
| 8 | + MailTrigger = apps.get_model('mailtrigger', 'MailTrigger') |
| 9 | + Recipient = apps.get_model('mailtrigger', 'Recipient') |
| 10 | + |
| 11 | + Recipient.objects.create( |
| 12 | + slug = 'new_wg_doc_list', |
| 13 | + desc = "The email list for announcing new WG -00 submissions", |
| 14 | + template = '<new-wg-docs@ietf.org>' |
| 15 | + ) |
| 16 | + changed = MailTrigger.objects.create( |
| 17 | + slug = 'sub_new_wg_00', |
| 18 | + desc = 'Recipients when a new IETF WG -00 draft is announced', |
| 19 | + ) |
| 20 | + changed.to.set(Recipient.objects.filter(slug__in=['new_wg_doc_list'])) |
| 21 | + |
| 22 | + |
| 23 | +def reverse(apps, schema_editor): |
| 24 | + MailTrigger = apps.get_model('mailtrigger','MailTrigger') |
| 25 | + Recipient = apps.get_model('mailtrigger', 'Recipient') |
| 26 | + |
| 27 | + MailTrigger.objects.filter(slug='sub_new_wg_00').delete() |
| 28 | + Recipient.objects.filter(slug='new_wg_doc_list').delete() |
| 29 | + |
| 30 | + |
| 31 | +class Migration(migrations.Migration): |
| 32 | + |
| 33 | + dependencies = [ |
| 34 | + ('mailtrigger', '0005_slides_proposed'), |
| 35 | + ] |
| 36 | + |
| 37 | + operations = [ |
| 38 | + migrations.RunPython(forward,reverse) |
| 39 | + ] |
0 commit comments