Avoid using model property in migration

https://stackoverflow.com/a/3315547

Thanks @mmolitor87
This commit is contained in:
Adarnof 2017-12-21 15:15:01 -05:00 committed by GitHub
parent 07afaf12d5
commit 82ad3821c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ def populate_ownerships(apps, schema_editor):
for c_id in unique_character_owners: for c_id in unique_character_owners:
ts = tokens.filter(character_id=c_id).order_by('created') ts = tokens.filter(character_id=c_id).order_by('created')
for t in ts: for t in ts:
if t.can_refresh: if t.refresh_token:
# find newest refreshable token and use it as basis for CharacterOwnership # find newest refreshable token and use it as basis for CharacterOwnership
CharacterOwnership.objecs.create_by_token(t) CharacterOwnership.objecs.create_by_token(t)
break break