Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
saturn
Commits
a5fe2768
Commit
a5fe2768
authored
6 years ago
by
zhanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/user_list' into 'test'
抓取添加platform参数 See merge request
!27
parents
1059b991
f332cc92
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
topic.py
api/views/topic.py
+8
-1
No files found.
api/views/topic.py
View file @
a5fe2768
...
@@ -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
=
[]
if
platform
==
GRAP_PLATFORM
.
INS
:
for
item
in
topics
:
for
item
in
topics
:
_id
=
item
.
get
(
"id"
)
_id
=
item
.
get
(
"id"
)
if
not
_id
:
continue
exists
=
ins_cache
.
sismember
(
ins_account_cache
,
_id
)
exists
=
ins_cache
.
sismember
(
ins_account_cache
,
_id
)
if
exists
:
if
exists
:
continue
continue
topic_list
.
append
(
item
)
topic_list
.
append
(
item
)
not_exists_ids
.
append
(
_id
)
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]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment