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

View file

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