Commit 5b32032c authored by 许俊鹏's avatar 许俊鹏

对文件重的数据做一次过滤

parent 8d919e97
......@@ -110,6 +110,12 @@ class AddVirtFans(APIView):
fans_num_column = [item.value for item in columns[1]]
user_id_fans_num_data = list(zip(user_id_column[1:], fans_num_column[1:]))
#做一次数据清洗。 避免文件中的空行
user_id_fans_num_data = [
(user_id, fans_num) for user_id, fans_num in user_id_fans_num_data
if isinstance(user_id, int) and isinstance(fans_num, int)
]
try:
self.rpc['venus/sun/tools/add_virt_fans'](data=user_id_fans_num_data).unwrap()
except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment