Commit 12f7dae4 authored by 王浩's avatar 王浩

Merge branch 'haow/tag' into 'test'

批量创建帖子调整

See merge request alpha/saturn!8
parents 745c2390 68d9f160
...@@ -93,7 +93,7 @@ class Sensitive(object): ...@@ -93,7 +93,7 @@ class Sensitive(object):
if not data or "detail" in data: # 程序出错啦 if not data or "detail" in data: # 程序出错啦
return return
action = data["result"]["action"] action = data.get("result", {}).get("action", 0)
if action == 0 or action == 1: # "通过" if action == 0 or action == 1: # "通过"
return [] return []
......
...@@ -29,9 +29,13 @@ class CreateTopicForBatch(BaseView): ...@@ -29,9 +29,13 @@ class CreateTopicForBatch(BaseView):
# 敏感词检测,获取可用的帖子 # 敏感词检测,获取可用的帖子
check_info = Sensitive.check([topic["content"] for topic in topic_list if topic.get("content")]) check_info = Sensitive.check([topic["content"] for topic in topic_list if topic.get("content")])
for topic in topic_list: for topic in topic_list:
succ = check_info.get(topic.get("content")) if topic.get("content") else True if topic.get('content'):
if not succ: succ = check_info.get(topic.get("content"))
topics.append(topic) if not succ:
topics.append(topic)
else:
if topic.get('images') or topic.get('video'):
topics.append(topic)
if not topics: if not topics:
return self.ok() return self.ok()
......
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