mirror of https://github.com/jumpserver/jumpserver
fix: 修改迁移 connection-token system_user -> account 字段失败的问题
parent
6a9f1978bb
commit
3c93ed6a75
|
@ -16,9 +16,11 @@ def migrate_system_user_to_account(apps, schema_editor):
|
|||
count += len(connection_tokens)
|
||||
updated = []
|
||||
for connection_token in connection_tokens:
|
||||
if not connection_token.system_user:
|
||||
continue
|
||||
connection_token.account = connection_token.system_user.username
|
||||
updated.append(connection_token)
|
||||
connection_token_model.objects.bulk_update(updated, ['account_username'])
|
||||
connection_token_model.objects.bulk_update(updated, ['account'])
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
Loading…
Reference in New Issue