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
0
Merge Requests
0
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
钟尚武
saturn
Commits
12f7dae4
Commit
12f7dae4
authored
Jan 11, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/tag' into 'test'
批量创建帖子调整 See merge request
alpha/saturn!8
parents
745c2390
68d9f160
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
sensitive.py
api/utils/sensitive.py
+1
-1
topic.py
api/views/topic.py
+7
-3
No files found.
api/utils/sensitive.py
View file @
12f7dae4
...
@@ -93,7 +93,7 @@ class Sensitive(object):
...
@@ -93,7 +93,7 @@ class Sensitive(object):
if
not
data
or
"detail"
in
data
:
# 程序出错啦
if
not
data
or
"detail"
in
data
:
# 程序出错啦
return
return
action
=
data
[
"result"
][
"action"
]
action
=
data
.
get
(
"result"
,
{})
.
get
(
"action"
,
0
)
if
action
==
0
or
action
==
1
:
# "通过"
if
action
==
0
or
action
==
1
:
# "通过"
return
[]
return
[]
...
...
api/views/topic.py
View file @
12f7dae4
...
@@ -29,9 +29,13 @@ class CreateTopicForBatch(BaseView):
...
@@ -29,9 +29,13 @@ class CreateTopicForBatch(BaseView):
# 敏感词检测,获取可用的帖子
# 敏感词检测,获取可用的帖子
check_info
=
Sensitive
.
check
([
topic
[
"content"
]
for
topic
in
topic_list
if
topic
.
get
(
"content"
)])
check_info
=
Sensitive
.
check
([
topic
[
"content"
]
for
topic
in
topic_list
if
topic
.
get
(
"content"
)])
for
topic
in
topic_list
:
for
topic
in
topic_list
:
succ
=
check_info
.
get
(
topic
.
get
(
"content"
))
if
topic
.
get
(
"content"
)
else
True
if
topic
.
get
(
'content'
):
if
not
succ
:
succ
=
check_info
.
get
(
topic
.
get
(
"content"
))
topics
.
append
(
topic
)
if
not
succ
:
topics
.
append
(
topic
)
else
:
if
topic
.
get
(
'images'
)
or
topic
.
get
(
'video'
):
topics
.
append
(
topic
)
if
not
topics
:
if
not
topics
:
return
self
.
ok
()
return
self
.
ok
()
...
...
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