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
92ecf990
Commit
92ecf990
authored
Aug 09, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
fix code See merge request
alpha/saturn!92
parents
4277d290
cd6f01a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
pictorial.py
api/views/pictorial.py
+2
-7
No files found.
api/views/pictorial.py
View file @
92ecf990
...
@@ -105,7 +105,6 @@ class CreatePictorial(BaseView):
...
@@ -105,7 +105,6 @@ class CreatePictorial(BaseView):
topic
[
'user_id'
]
=
self
.
get_user_id
(
id_
=
topic
.
get
(
'id'
),
platform
=
platform
)
topic
[
'user_id'
]
=
self
.
get_user_id
(
id_
=
topic
.
get
(
'id'
),
platform
=
platform
)
error
,
topic_obj
=
self
.
call_rpc
(
'venus/community/crawl/topic'
,
data
=
topic
,
platform
=
platform
,
pictorial_id
=
None
)
error
,
topic_obj
=
self
.
call_rpc
(
'venus/community/crawl/topic'
,
data
=
topic
,
platform
=
platform
,
pictorial_id
=
None
)
if
error
:
if
error
:
self
.
del_cache
()
return
error
,
_
return
error
,
_
if
not
topic_comments
:
if
not
topic_comments
:
continue
continue
...
@@ -117,10 +116,8 @@ class CreatePictorial(BaseView):
...
@@ -117,10 +116,8 @@ class CreatePictorial(BaseView):
obj
.
pop
(
'user'
)
obj
.
pop
(
'user'
)
error
,
_
=
self
.
call_rpc
(
'venus/community/crawl/replys'
,
data
=
topic_comments
,
platform
=
platform
,
topic_id
=
topic_obj
.
get
(
'id'
))
error
,
_
=
self
.
call_rpc
(
'venus/community/crawl/replys'
,
data
=
topic_comments
,
platform
=
platform
,
topic_id
=
topic_obj
.
get
(
'id'
))
if
error
:
if
error
:
self
.
del_cache
()
return
error
,
_
return
error
,
_
self
.
del_cache
()
return
None
,
None
return
None
,
None
def
create_pictorial
(
self
,
pictorial
,
platform
):
def
create_pictorial
(
self
,
pictorial
,
platform
):
...
@@ -151,7 +148,6 @@ class CreatePictorial(BaseView):
...
@@ -151,7 +148,6 @@ class CreatePictorial(BaseView):
pictorial
[
'name'
]
=
pictorial
.
get
(
'content'
)[:
index_end
]
pictorial
[
'name'
]
=
pictorial
.
get
(
'content'
)[:
index_end
]
error
,
pictorial_obj
=
self
.
call_rpc
(
'venus/community/crawl/pictorial'
,
data
=
pictorial
,
platform
=
platform
)
error
,
pictorial_obj
=
self
.
call_rpc
(
'venus/community/crawl/pictorial'
,
data
=
pictorial
,
platform
=
platform
)
if
error
:
if
error
:
self
.
del_cache
()
return
error
,
None
return
error
,
None
pictorial_id
=
pictorial_obj
.
get
(
'id'
)
pictorial_id
=
pictorial_obj
.
get
(
'id'
)
...
@@ -160,7 +156,6 @@ class CreatePictorial(BaseView):
...
@@ -160,7 +156,6 @@ class CreatePictorial(BaseView):
error
,
id_
=
self
.
call_rpc
(
'venus/community/crawl/topic'
,
data
=
obj
,
platform
=
platform
,
pictorial_id
=
pictorial_id
)
error
,
id_
=
self
.
call_rpc
(
'venus/community/crawl/topic'
,
data
=
obj
,
platform
=
platform
,
pictorial_id
=
pictorial_id
)
if
error
:
if
error
:
self
.
del_cache
()
return
error
,
None
return
error
,
None
if
pictorial_comments
:
if
pictorial_comments
:
if
platform
==
GRAP_PLATFORM
.
XIAOHONGSHU
:
if
platform
==
GRAP_PLATFORM
.
XIAOHONGSHU
:
...
@@ -171,10 +166,8 @@ class CreatePictorial(BaseView):
...
@@ -171,10 +166,8 @@ class CreatePictorial(BaseView):
error
,
_
=
self
.
call_rpc
(
'venus/community/crawl/replys'
,
data
=
pictorial_comments
,
platform
=
platform
,
pictorial_id
=
pictorial_id
)
error
,
_
=
self
.
call_rpc
(
'venus/community/crawl/replys'
,
data
=
pictorial_comments
,
platform
=
platform
,
pictorial_id
=
pictorial_id
)
if
error
:
if
error
:
self
.
del_cache
()
return
error
,
None
return
error
,
None
self
.
del_cache
()
return
None
,
None
return
None
,
None
def
post
(
self
,
request
):
def
post
(
self
,
request
):
...
@@ -204,10 +197,12 @@ class CreatePictorial(BaseView):
...
@@ -204,10 +197,12 @@ class CreatePictorial(BaseView):
for
obj
in
topics
:
for
obj
in
topics
:
error
,
_
=
self
.
create_pictorial
(
pictorial
=
obj
,
platform
=
platform
)
error
,
_
=
self
.
create_pictorial
(
pictorial
=
obj
,
platform
=
platform
)
if
error
:
if
error
:
self
.
del_cache
()
return
self
.
error
(
error
=
error
)
return
self
.
error
(
error
=
error
)
else
:
else
:
error
,
_
=
self
.
create_topic
(
topics
=
topics
,
platform
=
platform
)
error
,
_
=
self
.
create_topic
(
topics
=
topics
,
platform
=
platform
)
if
error
:
if
error
:
self
.
del_cache
()
return
self
.
error
(
error
=
error
)
return
self
.
error
(
error
=
error
)
self
.
del_cache
()
self
.
del_cache
()
...
...
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