Skip to content

Commit 76f6364

Browse files
committed
fix: 修复导入csv空行没有过滤的问题
--bug=1047841 --user=刘瑞斌 【知识库】上传csv格式的表格模版,第一行标题导入后分段显示不全 https://www.tapd.cn/57709429/s/1597113
1 parent bb4db65 commit 76f6364

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/common/handle/impl/table/csv_parse_table_handle.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def handle(self, file, get_buffer,save_image):
2828
# 第一行为标题
2929
title = csv_model[0].split(',')
3030
for row in csv_model[1:]:
31+
if not row:
32+
continue
3133
line = '; '.join([f'{key}:{value}' for key, value in zip(title, row.split(','))])
3234
paragraphs.append({'title': '', 'content': line})
3335

0 commit comments

Comments
 (0)