Commit a5fe2768 authored by zhanglu's avatar zhanglu

Merge branch 'feature/user_list' into 'test'

抓取添加platform参数

See merge request alpha/saturn!27
parents 1059b991 f332cc92
...@@ -6,6 +6,7 @@ from api.cache.cache import ins_cache ...@@ -6,6 +6,7 @@ from api.cache.cache import ins_cache
from libs.user import get_user_by_ids from libs.user import get_user_by_ids
from alpha_types.venus import ERROR as CODES from alpha_types.venus import ERROR as CODES
from alpha_types.venus import GRAP_PLATFORM
ins_account_cache = "ins_account_cache" ins_account_cache = "ins_account_cache"
...@@ -22,6 +23,7 @@ class CreateTopicForBatch(BaseView): ...@@ -22,6 +23,7 @@ class CreateTopicForBatch(BaseView):
card_level = request.POST.get("card_level", 0) card_level = request.POST.get("card_level", 0)
tag_id = request.POST.get("tag_id") tag_id = request.POST.get("tag_id")
is_online = request.POST.get("is_online", 0) is_online = request.POST.get("is_online", 0)
platform = request.POST.get("platform")
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:
...@@ -66,15 +68,20 @@ class CreateTopicForBatch(BaseView): ...@@ -66,15 +68,20 @@ class CreateTopicForBatch(BaseView):
not_exists_ids = [] not_exists_ids = []
topic_list = [] topic_list = []
for item in topics: if platform == GRAP_PLATFORM.INS:
for item in topics:
_id = item.get("id") _id = item.get("id")
exists = ins_cache.sismember(ins_account_cache, _id) if not _id:
if exists: continue
continue
exists = ins_cache.sismember(ins_account_cache, _id)
topic_list.append(item) if exists:
not_exists_ids.append(_id) continue
topic_list.append(item)
not_exists_ids.append(_id)
else:
topic_list = topics
# 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