always use get_model in migrations

This commit is contained in:
j3d1 2024-06-23 01:33:24 +02:00
parent 7d1786f143
commit a59509a432
5 changed files with 3 additions and 22 deletions

View file

@ -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 == '':