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

@ -1,8 +1,6 @@
from django.conf import settings
from django.db import migrations
from authentication.models import ExtendedUser
class Migration(migrations.Migration):
dependencies = [
@ -11,6 +9,7 @@ class Migration(migrations.Migration):
]
def create_legacy_user(apps, schema_editor):
ExtendedUser = apps.get_model('authentication', 'ExtendedUser')
ExtendedUser.objects.create_user(settings.LEGACY_USER_NAME, 'mail@' + settings.MAIL_DOMAIN,
settings.LEGACY_USER_PASSWORD)