always use get_model in migrations
This commit is contained in:
parent
7d1786f143
commit
a59509a432
5 changed files with 3 additions and 22 deletions
|
@ -3,7 +3,6 @@
|
|||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import files.models
|
||||
from mail.models import Email
|
||||
from mail.protocol import parse_email_body
|
||||
|
||||
|
||||
|
@ -24,6 +23,7 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
def generate_email_attachments(apps, schema_editor):
|
||||
Email = apps.get_model('mail', 'Email')
|
||||
for email in Email.objects.all():
|
||||
raw = email.raw
|
||||
if raw is None or raw == '':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue