Commit a608d901 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/like18' into 'dev'

BODY_ESTHETICS

See merge request !199
parents 9d72d36c b62f7b8a
...@@ -115,11 +115,14 @@ class TopicUpdateOrCreateView(APIView): ...@@ -115,11 +115,14 @@ class TopicUpdateOrCreateView(APIView):
return {'data': data} return {'data': data}
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', '[]'))))
cut_word_tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('cut_word_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', '[]'))) pictorial_ids = list(json.loads(request.POST.get('pictorial_ids', '[]')))
data = { data = {
...@@ -140,6 +143,8 @@ class TopicUpdateOrCreateView(APIView): ...@@ -140,6 +143,8 @@ class TopicUpdateOrCreateView(APIView):
'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', ''),
'is_home': int(request.POST.get('is_home', 0)), '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: try:
self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap() self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap()
......
...@@ -55,10 +55,13 @@ class UserUpdateOrCreate(APIView): ...@@ -55,10 +55,13 @@ class UserUpdateOrCreate(APIView):
return data return data
def post(self, request): def post(self, request):
id = request.POST.get('id', '') id = request.POST.get('id', '')
user_id = request.POST.get('user_id', '') user_id = request.POST.get('user_id', '')
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', '[]'))))
password = make_password(settings.PUPPET_PASSWORD, None, 'pbkdf2_sha256') 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 = { data = {
'user_id': user_id, 'user_id': user_id,
...@@ -73,6 +76,7 @@ class UserUpdateOrCreate(APIView): ...@@ -73,6 +76,7 @@ class UserUpdateOrCreate(APIView):
'email': request.POST.get('email'), 'email': request.POST.get('email'),
'gender': request.POST.get('gender'), 'gender': request.POST.get('gender'),
'is_tcc': int(request.POST.get('is_tcc', 0)), 'is_tcc': int(request.POST.get('is_tcc', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids,
} }
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment