Skip to content

Commit

Permalink
Use last-call@ietf.org. Commit ready for merge.
Browse files Browse the repository at this point in the history
 - Legacy-Id: 16824
  • Loading branch information
rjsparks committed Oct 4, 2019
1 parent 84270a7 commit 039d623
Show file tree
Hide file tree
Showing 4 changed files with 11,749 additions and 13,666 deletions.
49 changes: 49 additions & 0 deletions ietf/mailtrigger/migrations/0010_ietf_last_call.py
@@ -0,0 +1,49 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-04 12:12
from __future__ import unicode_literals

from django.db import migrations

def forward(apps, schema_editor):
MailTrigger = apps.get_model('mailtrigger','MailTrigger')
Recipient = apps.get_model('mailtrigger','Recipient')

ietf_last_call = Recipient.objects.create(
slug = 'ietf_last_call',
desc = 'The IETF Last Call list',
template = 'last-call@ietf.org'
)
ietf_general = Recipient.objects.get(slug='ietf_general')

review_completed_triggers = MailTrigger.objects.filter(slug__startswith='review_completed')

for trigger in review_completed_triggers:
trigger.cc.remove(ietf_general)
trigger.cc.add(ietf_last_call)

def reverse(apps, schema_editor):
MailTrigger = apps.get_model('mailtrigger','MailTrigger')
Recipient = apps.get_model('mailtrigger','Recipient')

ietf_general = Recipient.objects.get(slug='ietf_general')
ietf_last_call = Recipient.objects.get(slug='ietf_last_call')

review_completed_triggers = MailTrigger.objects.filter(slug__startswith='review_completed')

for trigger in review_completed_triggers:
trigger.cc.remove(ietf_last_call)
trigger.cc.add(ietf_general)

ietf_last_call.delete()


class Migration(migrations.Migration):

dependencies = [
('mailtrigger', '0009_custom_review_complete_mailtriggers'),
]

operations = [
migrations.RunPython(forward, reverse),
]

0 comments on commit 039d623

Please sign in to comment.