fix: 修复迁移的 sftp 数量不对

pull/11442/head
ibuler 2023-08-28 16:48:22 +08:00
parent 859268f7f3
commit 09db2ad3e1
1 changed files with 2 additions and 2 deletions

View File

@ -49,11 +49,11 @@ def migrate_assets_sftp_protocol(apps, schema_editor):
count = 0
print("\nAsset add sftp protocol: ")
asset_ids = asset_cls.objects\
asset_ids = list(asset_cls.objects\
.filter(platform__in=sftp_platforms)\
.exclude(protocols__name='sftp')\
.distinct()\
.values_list('id', flat=True)
.values_list('id', flat=True))
while True:
_asset_ids = asset_ids[count:count + 1000]
if not _asset_ids: