forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0006_sub_new_wg_00.py
More file actions
39 lines (28 loc) · 1.13 KB
/
0006_sub_new_wg_00.py
File metadata and controls
39 lines (28 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.db import migrations
def forward(apps, schema_editor):
MailTrigger = apps.get_model('mailtrigger', 'MailTrigger')
Recipient = apps.get_model('mailtrigger', 'Recipient')
Recipient.objects.create(
slug = 'new_wg_doc_list',
desc = "The email list for announcing new WG -00 submissions",
template = '<new-wg-docs@ietf.org>'
)
changed = MailTrigger.objects.create(
slug = 'sub_new_wg_00',
desc = 'Recipients when a new IETF WG -00 draft is announced',
)
changed.to.set(Recipient.objects.filter(slug__in=['new_wg_doc_list']))
def reverse(apps, schema_editor):
MailTrigger = apps.get_model('mailtrigger','MailTrigger')
Recipient = apps.get_model('mailtrigger', 'Recipient')
MailTrigger.objects.filter(slug='sub_new_wg_00').delete()
Recipient.objects.filter(slug='new_wg_doc_list').delete()
class Migration(migrations.Migration):
dependencies = [
('mailtrigger', '0005_slides_proposed'),
]
operations = [
migrations.RunPython(forward,reverse)
]