fix: 修改迁移 connection-token system_user -> account 字段失败的问题

pull/9327/head^2
Bai 2023-01-17 12:13:36 +08:00 committed by Jiangjie.Bai
parent 3c93ed6a75
commit f647f88536
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ def migrate_system_user_to_account(apps, schema_editor):
for connection_token in connection_tokens:
if not connection_token.system_user:
continue
connection_token.account = connection_token.system_user.username
connection_token.account_username = connection_token.system_user.username
updated.append(connection_token)
connection_token_model.objects.bulk_update(updated, ['account'])
connection_token_model.objects.bulk_update(updated, ['account_username'])
class Migration(migrations.Migration):