Commit c8767792 authored by zhanglu's avatar zhanglu

Merge branch 'hotfix/Sensitive' into 'master'

fix Sensitive

See merge request alpha/saturn!17
parents 5abc8c42 e1531ba3
...@@ -93,11 +93,20 @@ class Sensitive(object): ...@@ -93,11 +93,20 @@ class Sensitive(object):
if not data or "detail" in data: # 程序出错啦 if not data or "detail" in data: # 程序出错啦
return return
action = data.get("result", {}).get("action", 0) result = data.get("result", {})
if result:
action = result.get("action", 0)
else:
action = 0
if action == 0 or action == 1: # "通过" if action == 0 or action == 1: # "通过"
return [] return []
lables = data.get("result", {}).get("labels", []) if result:
lables = result.get("labels", [])
else:
lables = []
for lable in lables: for lable in lables:
hints.extend(lable.get('details', {}).get("hint")) hints.extend(lable.get('details', {}).get("hint"))
......
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