Browse Source

fix: 账号备份只导出一条记录 (#12517)

Co-authored-by: wangruidong <940853815@qq.com>
pull/12524/head
fit2bot 11 months ago committed by GitHub
parent
commit
6dcc74a388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      apps/accounts/automations/backup_account/handlers.py
  2. 6
      apps/accounts/automations/change_secret/manager.py

6
apps/accounts/automations/backup_account/handlers.py

@ -145,9 +145,9 @@ class AccountBackupHandler:
wb = Workbook(filename)
for sheet, data in data_map.items():
ws = wb.add_worksheet(str(sheet))
for row in data:
for col, _data in enumerate(row):
ws.write_string(0, col, _data)
for row_index, row_data in enumerate(data):
for col_index, col_data in enumerate(row_data):
ws.write_string(row_index, col_index, col_data)
wb.close()
files.append(filename)
timedelta = round((time.time() - time_start), 2)

6
apps/accounts/automations/change_secret/manager.py

@ -228,8 +228,8 @@ class ChangeSecretManager(AccountBasePlaybookManager):
rows.insert(0, header)
wb = Workbook(filename)
ws = wb.add_worksheet('Sheet1')
for row in rows:
for col, data in enumerate(row):
ws.write_string(0, col, data)
for row_index, row_data in enumerate(rows):
for col_index, col_data in enumerate(row_data):
ws.write_string(row_index, col_index, col_data)
wb.close()
return True

Loading…
Cancel
Save