perf: 去掉没有 Name 的迁移

pull/9788/head
ibuler 2023-02-27 14:00:17 +08:00 committed by Jiangjie.Bai
parent 972d6fb924
commit 454a38f994
1 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,8 @@ def migrate_asset_accounts(apps, schema_editor):
auth_infos.append((username, 'password', ''))
for name, secret_type, secret in auth_infos:
if not name:
continue
account = account_model(**account_values, name=name, secret=secret, secret_type=secret_type)
accounts.append(account)
@ -167,6 +169,9 @@ def migrate_db_accounts(apps, schema_editor):
values['secret_type'] = secret_type
values['secret'] = secret
if not name:
continue
for app in apps:
values['asset_id'] = str(app.id)
account = account_model(**values)