fix: 修复parser没有处理int类型数据的问题

pull/6221/head
Michael Bai 2021-05-22 00:09:54 +08:00 committed by 老广
parent 344c291583
commit 911ed45d6a
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class BaseFileParser(BaseParser):
new_row_data = {}
serializer_fields = self.serializer_fields
for k, v in row_data.items():
if isinstance(v, list) or isinstance(v, dict) or isinstance(v, str) and k.strip() and v.strip():
if type(v) in [list, dict, int] or (isinstance(v, str) and k.strip() and v.strip()):
# 解决类似disk_info为字符串的'{}'的问题
if not isinstance(v, str) and isinstance(serializer_fields[k], serializers.CharField):
v = str(v)