Skip to content

Commit

Permalink
fix: 修复parser没有处理int类型数据的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BaiJiangJie authored and ibuler committed May 24, 2021
1 parent 344c291 commit 911ed45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/common/drf/parsers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def process_row_data(self, row_data):
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)
Expand Down

0 comments on commit 911ed45

Please sign in to comment.