fix: enstat to_repre时若使用query时的bug
This commit is contained in:
parent
85bbdd6cd9
commit
9572614b02
|
@ -140,8 +140,8 @@ class EnStatSerializer(CustomModelSerializer):
|
|||
ret_one_val = ret[key]
|
||||
if isinstance(ret_one_val, float):
|
||||
ret[key] = "{:.2f}".format(round(ret_one_val, 2))
|
||||
qua_data = ret["qua_data"]
|
||||
equip_elec_data = ret["equip_elec_data"]
|
||||
qua_data = ret.get("qua_data", {})
|
||||
equip_elec_data = ret.get("equip_elec_data", {})
|
||||
if qua_data:
|
||||
for item in qua_data:
|
||||
ret[f'{item["material_name"]}_{item["testitem_name"]}_rate_pass'] = "{:.2f}".format(round(item["rate_pass"], 4))
|
||||
|
|
Loading…
Reference in New Issue