From ee5bac099f3bad81bfc9c9a5d4f7195818980b93 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 17 Oct 2020 17:06:08 +0200 Subject: [PATCH] outposts: fix migration not having access to token property --- .../outposts/migrations/0009_fix_missing_token_identifier.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passbook/outposts/migrations/0009_fix_missing_token_identifier.py b/passbook/outposts/migrations/0009_fix_missing_token_identifier.py index 91025d556..0021a979a 100644 --- a/passbook/outposts/migrations/0009_fix_missing_token_identifier.py +++ b/passbook/outposts/migrations/0009_fix_missing_token_identifier.py @@ -6,7 +6,8 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor def fix_missing_token_identifier(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - Outpost = apps.get_model("passbook_outposts", "Outpost") + from passbook.outposts.models import Outpost + for outpost in Outpost.objects.using(schema_editor.connection.alias).all(): token = outpost.token if token.identifier != outpost.token_identifier: