datatracker/ietf/mailtrigger/migrations/0003_merge_request_trigger.py
Robert Sparks dc5ae398f2 Improved SearchablePersonField to show the primary email address for any search results where a name appears more than once.
Simplified the edit nominee form.
Replaced the merge nominee form with a request to the secretariat to merge Person records. Fixes #1847.
Added merging nominees to the secretariat's person merging script.
Restructured the person merging script to make it testable.
Updated some tests to match changes to the mailtriggers that hadn't made it to the fixtures.
 - Legacy-Id: 10625
2015-12-22 21:42:55 +00:00

29 lines
856 B
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Recipient=apps.get_model('mailtrigger','Recipient')
MailTrigger=apps.get_model('mailtrigger','MailTrigger')
m = MailTrigger.objects.create(
slug='person_merge_requested',
desc="Recipients for a message requesting that duplicated Person records be merged ")
m.to = Recipient.objects.filter(slug__in=['ietf_secretariat', ])
def reverse(apps, schema_editor):
MailTrigger=apps.get_model('mailtrigger','MailTrigger')
MailTrigger.objects.filter(slug='person_merge_requested').delete()
class Migration(migrations.Migration):
dependencies = [
('mailtrigger', '0002_auto_20150809_1314'),
]
operations = [
migrations.RunPython(forward, reverse)
]