From c6dddc97f015d09c48dfa6e2ff1f51df0c4af5e7 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 11 Aug 2021 22:36:52 +0200 Subject: [PATCH] core: fix error when migrating with AK_ADMIN_TOKEN set Signed-off-by: Jens Langhammer --- authentik/core/migrations/0027_bootstrap_token.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/authentik/core/migrations/0027_bootstrap_token.py b/authentik/core/migrations/0027_bootstrap_token.py index 42ab17423..742ef65e6 100644 --- a/authentik/core/migrations/0027_bootstrap_token.py +++ b/authentik/core/migrations/0027_bootstrap_token.py @@ -8,9 +8,7 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor def create_default_user_token(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): # We have to use a direct import here, otherwise we get an object manager error - from authentik.core.models import TokenIntents, User - - Token = apps.get_model("authentik_core", "token") + from authentik.core.models import Token, TokenIntents, User db_alias = schema_editor.connection.alias