Commit 00268486 authored by 王浩's avatar 王浩

modify batch create tag and topic

parent 59618e60
...@@ -10,8 +10,10 @@ class CreateTagForBatch(BaseView): ...@@ -10,8 +10,10 @@ 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)
tags = [] tags = []
if need_check:
# 敏感词检测,获取可用的帖子 # 敏感词检测,获取可用的帖子
check_info = Sensitive.check([item["name"] for item in tag_list if item.get("name")]) check_info = Sensitive.check([item["name"] for item in tag_list if item.get("name")])
for tag in tag_list: for tag in tag_list:
......
...@@ -49,7 +49,7 @@ class CreateTopicForBatch(BaseView): ...@@ -49,7 +49,7 @@ class CreateTopicForBatch(BaseView):
tag_names.extend([tag.replace("#", '').strip() for tag in tags]) tag_names.extend([tag.replace("#", '').strip() for tag in tags])
item["user_id"] = user_id item["user_id"] = user_id
item["card_level"] = card_level item["card_level"] = card_level
item["tag_id"] = tag_id 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)
......
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