Commit 8d3b5758 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/fix_pictorial' into 'master'

Ycl/fix pictorial

See merge request alpha/sun!352
parents ab384acb 5a62544c
......@@ -48,7 +48,6 @@ class PictorialUpdateOrCreate(APIView):
id = int(request.POST.get('id')) if request.POST.get('id') else None
star_ids = json.loads(request.POST.get('star', '[]'))
pictorial_user_ids = json.loads(request.POST.get('pictorial_user_ids', '[]'))
collection_tag_ids = json.loads(request.POST.get('collection_tag_ids', '[]'))
pictorial_activity_id = request.POST.get('pictorial_activity_id')
tab_config = request.POST.get("tab_config", "[]")
......@@ -59,7 +58,6 @@ class PictorialUpdateOrCreate(APIView):
'celebrity_ids': star_ids,
'is_online': int(request.POST.get('is_online', 1)),
'is_recommend': int(request.POST.get('is_recommend', 0)),
'pictorial_user_ids': pictorial_user_ids,
'icon': request.POST.get('icon', ''),
'collection_tag_ids': collection_tag_ids,
'is_home_recommend': int(request.POST.get('is_home_recommend', 0)),
......@@ -199,3 +197,37 @@ class PictorialTopicDel(APIView):
return {
'message': '删除成功'
}
class PictorialFollowsDel(APIView):
"""删除榜单中的关注者"""
def post(self, request):
pictorial_id = int(request.POST.get('pictorial_id', 0))
user_ids = json.loads(request.POST.get('user_ids', '[]'))
user_ids = [int(item) for item in user_ids]
try:
self.rpc['venus/sun/pictorial/follows/del'](pictorial_id=pictorial_id, user_ids=user_ids).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '删除成功'
}
class PictorialFollowsAdd(APIView):
"""新增榜单中的关注者"""
def post(self, request):
pictorial_id = int(request.POST.get('pictorial_id', 0))
user_ids = json.loads(request.POST.get('user_ids', '[]'))
user_ids = [int(item) for item in user_ids]
try:
self.rpc['venus/sun/pictorial/follows/add'](pictorial_id=pictorial_id, user_ids=user_ids).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '添加成功'
}
......@@ -161,6 +161,8 @@ urlpatterns = [
url(r'^pictorial/feed/rank$', PictorialFeedlRank.as_view()),
url(r'^pictorial/feed/delete$', PictorialFeedDelete.as_view()),
url(r'^pictorial/topic/list$', PictorialTopicList.as_view()),
url(r'^pictorial/follows/del$', PictorialFollowsDel.as_view()),
url(r'^pictorial/follows/add$', PictorialFollowsAdd.as_view()),
#运营位
url(r'^topic/home_recommend/list', TopicHomeRecommendList.as_view()),
......
......@@ -89,6 +89,7 @@ class UserUpdateOrCreate(APIView):
'body_esthetics_tag_ids': body_esthetics_tag_ids,
'expert_tag_ids': expert_tag_ids,
'is_kol': int(request.POST.get('is_kol', 0)),
'is_edit': int(request.POST.get('is_edit', 0)),
}
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