outposts: fix migration not having access to token property

This commit is contained in:
Jens Langhammer 2020-10-17 17:06:08 +02:00
parent 69f7b41044
commit ee5bac099f
1 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,8 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor
def fix_missing_token_identifier(apps: Apps, schema_editor: 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(): for outpost in Outpost.objects.using(schema_editor.connection.alias).all():
token = outpost.token token = outpost.token
if token.identifier != outpost.token_identifier: if token.identifier != outpost.token_identifier: