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
a3ae7dc5
Commit
a3ae7dc5
authored
Apr 03, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'dev'
fix some code See merge request
alpha/sun!165
parents
7918da23
cb5e01c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
topic.py
api/topic.py
+4
-4
No files found.
api/topic.py
View file @
a3ae7dc5
...
@@ -116,7 +116,7 @@ class TopicUpdateOrCreateView(APIView):
...
@@ -116,7 +116,7 @@ class TopicUpdateOrCreateView(APIView):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
id
=
request
.
POST
.
get
(
'id'
,
''
)
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
[]
))))
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
'[]'
))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
pictorial_ids
=
list
(
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
)))
pictorial_ids
=
list
(
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
)))
...
@@ -126,14 +126,14 @@ class TopicUpdateOrCreateView(APIView):
...
@@ -126,14 +126,14 @@ class TopicUpdateOrCreateView(APIView):
'video_url'
:
request
.
POST
.
get
(
'video_url'
,
''
),
'video_url'
:
request
.
POST
.
get
(
'video_url'
,
''
),
'posting_time'
:
request
.
POST
.
get
(
'posting_time'
),
'posting_time'
:
request
.
POST
.
get
(
'posting_time'
),
'content'
:
request
.
POST
.
get
(
'content'
,
''
),
'content'
:
request
.
POST
.
get
(
'content'
,
''
),
'content_level'
:
request
.
POST
.
get
(
'content_level'
,
''
),
'content_level'
:
request
.
POST
.
get
(
'content_level'
,
0
),
'pictorial_ids'
:
pictorial_ids
,
'pictorial_ids'
:
pictorial_ids
,
'user_id'
:
request
.
POST
.
get
(
'user'
,
''
)
.
split
(
':'
)[
0
],
'user_id'
:
request
.
POST
.
get
(
'user'
,
''
)
.
split
(
':'
)[
0
],
'star_id'
:
request
.
POST
.
get
(
'star'
,
''
)
.
split
(
':'
)[
0
],
'star_id'
:
request
.
POST
.
get
(
'star'
,
''
)
.
split
(
':'
)[
0
],
'tag_ids'
:
tag_ids
,
'tag_ids'
:
tag_ids
,
'collection_tag_ids'
:
collection_tag_ids
,
'collection_tag_ids'
:
collection_tag_ids
,
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
,
0
)),
'drop_score'
:
int
(
request
.
POST
.
get
(
'drop_score'
)),
'drop_score'
:
int
(
request
.
POST
.
get
(
'drop_score'
,
0
)),
'has_image'
:
1
if
topic_images
else
0
,
'has_image'
:
1
if
topic_images
else
0
,
'has_video'
:
1
if
request
.
POST
.
get
(
'video_url'
,
''
)
else
0
,
'has_video'
:
1
if
request
.
POST
.
get
(
'video_url'
,
''
)
else
0
,
'virtual_vote_num'
:
request
.
POST
.
get
(
'virtual_vote_num'
,
''
),
'virtual_vote_num'
:
request
.
POST
.
get
(
'virtual_vote_num'
,
''
),
...
...
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