Commit ee1eaf07 authored by 王浩's avatar 王浩

fix conflicts

parents 00268486 34ec6714
...@@ -10,7 +10,7 @@ class CreateTagForBatch(BaseView): ...@@ -10,7 +10,7 @@ class CreateTagForBatch(BaseView):
""" """
def post(self, request): def post(self, request):
tag_list = json.loads(request.POST.get("tags", '[]')) tag_list = json.loads(request.POST.get("tags", '[]'))
need_check = request.POST.get('need_check', 1) need_check = request.POST.get('need_check', 0)
tags = [] tags = []
if need_check: if need_check:
...@@ -20,6 +20,8 @@ class CreateTagForBatch(BaseView): ...@@ -20,6 +20,8 @@ class CreateTagForBatch(BaseView):
succ = check_info.get(tag.get("name")) if tag.get("name") else True succ = check_info.get(tag.get("name")) if tag.get("name") else True
if not succ: if not succ:
tags.append(tag) tags.append(tag)
else:
tags = tag_list
error, data = self.call_rpc('venus/community/tag/batch_create_not_classify', data=tags) error, data = self.call_rpc('venus/community/tag/batch_create_not_classify', data=tags)
......
...@@ -30,12 +30,18 @@ class CreateTopicForBatch(BaseView): ...@@ -30,12 +30,18 @@ class CreateTopicForBatch(BaseView):
topics = [] topics = []
# 敏感词检测,获取可用的帖子 # 敏感词检测,获取可用的帖子
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:
# 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)
for topic in topic_list: for topic in topic_list:
if topic.get('content'): if topic.get('content'):
succ = check_info.get(topic.get("content")) topics.append(topic)
if not succ:
topics.append(topic)
else: else:
if topic.get('images') or topic.get('video'): if topic.get('images') or topic.get('video'):
topics.append(topic) topics.append(topic)
...@@ -52,8 +58,9 @@ class CreateTopicForBatch(BaseView): ...@@ -52,8 +58,9 @@ class CreateTopicForBatch(BaseView):
item["tag_id"] = tag_id if tag_id else None item["tag_id"] = tag_id if tag_id else None
item["is_online"] = is_online item["is_online"] = is_online
check_info = Sensitive.check(tag_names) # check_info = Sensitive.check(tag_names)
tags = [tag_name for tag_name, succ in check_info.items() if not succ] # tags = [tag_name for tag_name, succ in check_info.items() if not succ]
tags = tag_names
# 先创建标签 # 先创建标签
_tag_error, _tag_data = self.call_rpc( _tag_error, _tag_data = self.call_rpc(
...@@ -107,12 +114,19 @@ class CreateTopicForBatchByOne(BaseView): ...@@ -107,12 +114,19 @@ class CreateTopicForBatchByOne(BaseView):
topics = [] topics = []
# 敏感词检测,获取可用的帖子 # 敏感词检测,获取可用的帖子
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:
# 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)
for topic in topic_list: for topic in topic_list:
if topic.get('content'): if topic.get('content'):
succ = check_info.get(topic.get("content")) topics.append(topic)
if not succ:
topics.append(topic)
else: else:
if topic.get('images') or topic.get('video'): if topic.get('images') or topic.get('video'):
topics.append(topic) topics.append(topic)
...@@ -128,8 +142,10 @@ class CreateTopicForBatchByOne(BaseView): ...@@ -128,8 +142,10 @@ class CreateTopicForBatchByOne(BaseView):
item["user_id"] = user_id item["user_id"] = user_id
need_create_topics.append(item) need_create_topics.append(item)
check_info = Sensitive.check(tag_names) # check_info = Sensitive.check(tag_names)
tags = [tag_name for tag_name, succ in check_info.items() if not succ] # tags = [tag_name for tag_name, succ in check_info.items() if not succ]
# check_info = Sensitive.check(tag_names)
tags = tag_names
# 先创建标签 # 先创建标签
_tag_error, _tag_data = self.call_rpc( _tag_error, _tag_data = self.call_rpc(
......
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