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) wb = Workbook(filename)
for sheet, data in data_map.items(): for sheet, data in data_map.items():
ws = wb.add_worksheet(str(sheet)) ws = wb.add_worksheet(str(sheet))
for row in data: for row_index, row_data in enumerate(data):
for col, _data in enumerate(row): for col_index, col_data in enumerate(row_data):
ws.write_string(0, col, _data) ws.write_string(row_index, col_index, col_data)
wb.close() wb.close()
files.append(filename) files.append(filename)
timedelta = round((time.time() - time_start), 2) 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) rows.insert(0, header)
wb = Workbook(filename) wb = Workbook(filename)
ws = wb.add_worksheet('Sheet1') ws = wb.add_worksheet('Sheet1')
for row in rows: for row_index, row_data in enumerate(rows):
for col, data in enumerate(row): for col_index, col_data in enumerate(row_data):
ws.write_string(0, col, data) ws.write_string(row_index, col_index, col_data)
wb.close() wb.close()
return True return True

Loading…
Cancel
Save