Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
钟尚武
sun
Commits
7c9f8bed
Commit
7c9f8bed
authored
Dec 01, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复错误
parent
e1f10e9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
topic.py
api/topic.py
+2
-3
user.py
api/user.py
+3
-1
No files found.
api/topic.py
View file @
7c9f8bed
...
...
@@ -41,7 +41,6 @@ class TopicUpdateOrCreateView(APIView):
posting_time
=
analysis_time
(
request
.
POST
.
get
(
'posting_time'
,
0
))
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
[]))))
data
=
{
'topic_images'
:
topic_images
,
# 'reply_ids': json.loads(request.POST.get('topic_ids', '')),
...
...
@@ -69,7 +68,7 @@ class ReplyUpdateOrCreateView(APIView):
offset
=
int
(
request
.
GET
.
get
(
'page'
,
0
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
filter
.
update
({
'topic_id'
:
id
})
filter
.
update
({
'topic_id'
:
id
,
'is_online'
:
1
})
try
:
data
=
self
.
rpc
[
'venus/sun/topic/reply/list'
](
offset
=
(
offset
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
...
...
@@ -79,7 +78,7 @@ class ReplyUpdateOrCreateView(APIView):
def
post
(
self
,
request
):
reply_ids
=
json
.
loads
(
request
.
POST
.
get
(
'reply_ids'
,
[]))
try
:
self
.
rpc
[
'venus/sun/topic/reply/batch_delete'
](
data
=
reply_ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/topic/reply/batch_delete'
](
ids
=
reply_ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
api/user.py
View file @
7c9f8bed
...
...
@@ -33,8 +33,10 @@ class UserUpdateOrCreate(APIView):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
user_id
=
request
.
POST
.
get
(
'user_id'
,
''
)
tag_ids
=
list
(
set
(
request
.
POST
.
get
(
'tag_ids'
)
.
split
(
','
)))
user_id
=
generate_id
()
if
not
user_id
:
user_id
=
generate_id
()
data
=
{
'user_id'
:
user_id
,
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
...
...
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