Commit edd72e77 authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

add some value in batch create topic

See merge request alpha/saturn!13
parents 583f6da7 89ef6c2e
...@@ -13,6 +13,8 @@ class CreateTopicForBatch(BaseView): ...@@ -13,6 +13,8 @@ class CreateTopicForBatch(BaseView):
def post(self, request): def post(self, request):
user_id = request.POST.get("user_id", 0) user_id = request.POST.get("user_id", 0)
card_level = request.POST.get("card_level")
tag_id = request.POST.get("tag_id")
topic_list = json.loads(request.POST.get("topic_list", '[]')) topic_list = json.loads(request.POST.get("topic_list", '[]'))
if not user_id: if not user_id:
...@@ -45,6 +47,8 @@ class CreateTopicForBatch(BaseView): ...@@ -45,6 +47,8 @@ class CreateTopicForBatch(BaseView):
tags = item.get("tags") or [] tags = item.get("tags") or []
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["tag_id"] = tag_id
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]
......
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