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