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
from libs.user import get_user_by_ids
from alpha_types.venus import ERROR as CODES
from alpha_types.venus import GRAP_PLATFORM
ins_account_cache = "ins_account_cache"
......@@ -22,6 +23,7 @@ class CreateTopicForBatch(BaseView):
card_level = request.POST.get("card_level", 0)
tag_id = request.POST.get("tag_id")
is_online = request.POST.get("is_online", 0)
platform = request.POST.get("platform")
topic_list = json.loads(request.POST.get("topic_list", '[]'))
if not user_id:
......@@ -66,15 +68,20 @@ class CreateTopicForBatch(BaseView):
not_exists_ids = []
topic_list = []
for item in topics:
_id = item.get("id")
exists = ins_cache.sismember(ins_account_cache, _id)
if exists:
continue
topic_list.append(item)
not_exists_ids.append(_id)
if platform == GRAP_PLATFORM.INS:
for item in topics:
_id = item.get("id")
if not _id:
continue
exists = ins_cache.sismember(ins_account_cache, _id)
if exists:
continue
topic_list.append(item)
not_exists_ids.append(_id)
else:
topic_list = topics
# check_info = Sensitive.check(tag_names)
# 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