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
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
sun
Commits
a608d901
Commit
a608d901
authored
May 08, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/like18' into 'dev'
BODY_ESTHETICS See merge request
!199
parents
9d72d36c
b62f7b8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
topic.py
api/topic.py
+5
-0
user.py
api/user.py
+4
-0
No files found.
api/topic.py
View file @
a608d901
...
...
@@ -115,11 +115,14 @@ class TopicUpdateOrCreateView(APIView):
return
{
'data'
:
data
}
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
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'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
cut_word_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'cut_word_tags'
,
'[]'
))))
body_esthetics_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'body_esthetics_tags'
,
'[]'
))))
pictorial_ids
=
list
(
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
)))
data
=
{
...
...
@@ -140,6 +143,8 @@ class TopicUpdateOrCreateView(APIView):
'has_video'
:
1
if
request
.
POST
.
get
(
'video_url'
,
''
)
else
0
,
'virtual_vote_num'
:
request
.
POST
.
get
(
'virtual_vote_num'
,
''
),
'is_home'
:
int
(
request
.
POST
.
get
(
'is_home'
,
0
)),
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
,
0
)),
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
}
try
:
self
.
rpc
[
'venus/sun/topic/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
...
api/user.py
View file @
a608d901
...
...
@@ -55,10 +55,13 @@ class UserUpdateOrCreate(APIView):
return
data
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
user_id
=
request
.
POST
.
get
(
'user_id'
,
''
)
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
password
=
make_password
(
settings
.
PUPPET_PASSWORD
,
None
,
'pbkdf2_sha256'
)
body_esthetics_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'body_esthetics_tags'
,
'[]'
))))
data
=
{
'user_id'
:
user_id
,
...
...
@@ -73,6 +76,7 @@ class UserUpdateOrCreate(APIView):
'email'
:
request
.
POST
.
get
(
'email'
),
'gender'
:
request
.
POST
.
get
(
'gender'
),
'is_tcc'
:
int
(
request
.
POST
.
get
(
'is_tcc'
,
0
)),
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
}
try
:
...
...
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