# Path: post_office/models.py
# STATUS = namedtuple('STATUS', 'sent failed queued requeued')._make(range(4))
# 
# Path: post_office/settings.py
# def get_message_id_enabled():
#     return get_config().get('MESSAGE_ID_ENABLED', False)
# 
# def get_message_id_fqdn():
#     return get_config().get('MESSAGE_ID_FQDN', DNS_NAME)


import random
from django.db import migrations, models
from post_office.models import STATUS
from post_office.settings import get_message_id_enabled, get_message_id_fqdn



def forwards(apps, schema_editor):
    if not get_message_id_enabled():
        return
    msg_id_fqdn = get_message_id_fqdn()
    Email = apps.get_model('post_office', 'Email')
    for email in Email.objects.using(schema_editor.connection.alias).filter(message_id__isnull=True):

# Path: post_office/models.py
# STATUS = namedtuple('STATUS', 'sent failed queued requeued')._make(range(4))
# 
# Path: post_office/settings.py
# def get_message_id_enabled():
#     return get_config().get('MESSAGE_ID_ENABLED', False)
# 
# def get_message_id_fqdn():
#     return get_config().get('MESSAGE_ID_FQDN', DNS_NAME)


# Path: post_office/migrations/0010_message_id.py
import random
from django.db import migrations, models
from post_office.models import STATUS
from post_office.settings import get_message_id_enabled, get_message_id_fqdn




def forwards(apps, schema_editor):
    if not get_message_id_enabled():
        return
    msg_id_fqdn = get_message_id_fqdn()
    Email = apps.get_model('post_office', 'Email')
    for email in Email.objects.using(schema_editor.connection.alias).filter(message_id__isnull=True):

        if email.status in [STATUS.queued, STATUS.requeued]: