Commit bdef5df7 authored by 钟尚武's avatar 钟尚武

Merge branch 'test' into 'master'

Like 2.3功能上线

See merge request alpha/sun!346
parents dc54a451 28b3b78f
...@@ -51,6 +51,7 @@ class PictorialUpdateOrCreate(APIView): ...@@ -51,6 +51,7 @@ class PictorialUpdateOrCreate(APIView):
pictorial_user_ids = json.loads(request.POST.get('pictorial_user_ids', '[]')) pictorial_user_ids = json.loads(request.POST.get('pictorial_user_ids', '[]'))
collection_tag_ids = json.loads(request.POST.get('collection_tag_ids', '[]')) collection_tag_ids = json.loads(request.POST.get('collection_tag_ids', '[]'))
pictorial_activity_id = request.POST.get('pictorial_activity_id') pictorial_activity_id = request.POST.get('pictorial_activity_id')
tab_config = request.POST.get("tab_config", "[]")
data = { data = {
'name': request.POST.get('name', ''), 'name': request.POST.get('name', ''),
'description': request.POST.get('description', ''), 'description': request.POST.get('description', ''),
...@@ -69,7 +70,7 @@ class PictorialUpdateOrCreate(APIView): ...@@ -69,7 +70,7 @@ class PictorialUpdateOrCreate(APIView):
'pictorial_activity_ids': [int(pictorial_activity_id)] if pictorial_activity_id else [], 'pictorial_activity_ids': [int(pictorial_activity_id)] if pictorial_activity_id else [],
'alias': request.POST.get('alias', ''), 'alias': request.POST.get('alias', ''),
'comment_talk': request.POST.get('pictorial_comment_talk', ''), 'comment_talk': request.POST.get('pictorial_comment_talk', ''),
'tab_config': json.loads(tab_config),
} }
try: try:
data = self.rpc['venus/sun/pictorial/edit'](id=id, data=data).unwrap() data = self.rpc['venus/sun/pictorial/edit'](id=id, data=data).unwrap()
......
...@@ -72,7 +72,7 @@ class ReplyVote(APIView): ...@@ -72,7 +72,7 @@ class ReplyVote(APIView):
vote_num = int(request.POST.get('vote_num')) vote_num = int(request.POST.get('vote_num'))
try: try:
self.rpc['venus/sun/reply/vote'](reply_id=reply_id, vote_num=vote_num).unwrap() self.rpc['venus/sun/reply/vote'](reply_id=reply_id, virtual_vote_num=vote_num).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'编辑帖子失败%s', e) error_logger.error(u'编辑帖子失败%s', e)
raise raise
......
...@@ -54,6 +54,12 @@ class TagUpdateOrCreateView(APIView): ...@@ -54,6 +54,12 @@ class TagUpdateOrCreateView(APIView):
down_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('down_tags', '[]')))))) down_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('down_tags', '[]'))))))
up_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('up_tags', '[]')))))) up_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('up_tags', '[]'))))))
tagtypes = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('tagtypes', '[]')))))) tagtypes = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('tagtypes', '[]'))))))
request.POST.get('official_pictorial_id', '').split(":")
official_pictorial_id = request.POST.get('official_pictorial_id', '').split(":")
if official_pictorial_id:
official_pictorial_id = official_pictorial_id[0]
else:
official_pictorial_id = None
data = { data = {
'name': request.POST.get('name').lower(), 'name': request.POST.get('name').lower(),
...@@ -65,6 +71,8 @@ class TagUpdateOrCreateView(APIView): ...@@ -65,6 +71,8 @@ class TagUpdateOrCreateView(APIView):
'platform': request.POST.get('platform', 1), 'platform': request.POST.get('platform', 1),
'collection': request.POST.get('collection', 0), 'collection': request.POST.get('collection', 0),
'alias': request.POST.get('alias', ''), 'alias': request.POST.get('alias', ''),
'is_core': request.POST.get('is_core', 0),
'official_pictorial_id': official_pictorial_id,
'is_show_in_register': request.POST.get('is_show_in_register', 'false'), 'is_show_in_register': request.POST.get('is_show_in_register', 'false'),
'pictorial_ids': list( 'pictorial_ids': list(
(map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorial_ids', '[]')))))) (map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorial_ids', '[]'))))))
......
...@@ -66,6 +66,13 @@ class UserUpdateOrCreate(APIView): ...@@ -66,6 +66,13 @@ class UserUpdateOrCreate(APIView):
body_esthetics_tag_ids = list( body_esthetics_tag_ids = list(
map(lambda x: x.split(':')[0], json.loads(request.POST.get('body_esthetics_tags', '[]')))) map(lambda x: x.split(':')[0], json.loads(request.POST.get('body_esthetics_tags', '[]'))))
expert_tags = json.loads(request.POST.get('expert_tags', '[]'))
try:
expert_tag_ids = [[int(item[0].split(":")[0]), int(item[1])] for item in expert_tags]
except:
error_logger.error(u'创建/编辑%s用户详情失败%s' % (id, e))
raise
data = { data = {
'user_id': user_id, 'user_id': user_id,
'password': password, 'password': password,
...@@ -80,6 +87,7 @@ class UserUpdateOrCreate(APIView): ...@@ -80,6 +87,7 @@ class UserUpdateOrCreate(APIView):
'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, 'body_esthetics_tag_ids': body_esthetics_tag_ids,
'expert_tag_ids': expert_tag_ids,
'is_kol': int(request.POST.get('is_kol', 0)), 'is_kol': int(request.POST.get('is_kol', 0)),
} }
......
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