Commit 42438bb4 authored by 许俊鹏's avatar 许俊鹏

处理冲突

parents b0381018 e0438c35
...@@ -178,9 +178,16 @@ class ReplyManageBatchUpdate(APIView): ...@@ -178,9 +178,16 @@ class ReplyManageBatchUpdate(APIView):
def post(self, request): def post(self, request):
ids = json.loads(request.POST.get('ids', '[]')) ids = json.loads(request.POST.get('ids', '[]'))
is_online = request.POST.get('is_online', None)
data = { }
if request.POST.get('is_online') is not None:
data['is_online'] = True if int(request.POST.get('is_online', 0)) else False
if request.POST.get('is_quality') is not None:
data['is_quality'] = True if int(request.POST.get('is_quality', 0)) else False
try: try:
rep = self.rpc['venus/sun/reply/manage/batch/update'](ids=ids, is_online=is_online).unwrap() rep = self.rpc['venus/sun/reply/manage/batch/update'](ids=ids, data=data).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'更新-reply信息失败%s' % (e)) error_logger.error(u'更新-reply信息失败%s' % (e))
raise raise
......
...@@ -28,6 +28,8 @@ class TopicListView(APIView): ...@@ -28,6 +28,8 @@ class TopicListView(APIView):
filters.update({'drop_score': int(drop_score)}) filters.update({'drop_score': int(drop_score)})
elif int(drop_score) == 1: elif int(drop_score) == 1:
filters.update({'drop_score__exclude': int(drop_score)}) filters.update({'drop_score__exclude': int(drop_score)})
if filters.get("is_finished") is not None:
filters["is_finished"] = True if filters.get("is_finished") else False
res = self.rpc['physical/search/business/topic']( res = self.rpc['physical/search/business/topic'](
offset=(page-1) * limit, offset=(page-1) * limit,
...@@ -121,7 +123,6 @@ class TopicUpdateOrCreateView(APIView): ...@@ -121,7 +123,6 @@ class TopicUpdateOrCreateView(APIView):
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', '[]'))))
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', '[]'))))
pictorial_ids = list(json.loads(request.POST.get('pictorial_ids', '[]'))) pictorial_ids = list(json.loads(request.POST.get('pictorial_ids', '[]')))
...@@ -137,7 +138,6 @@ class TopicUpdateOrCreateView(APIView): ...@@ -137,7 +138,6 @@ class TopicUpdateOrCreateView(APIView):
'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,
'cut_word_tag_ids': cut_word_tag_ids,
'is_online': int(request.POST.get('is_online', 0)), 'is_online': int(request.POST.get('is_online', 0)),
'drop_score': int(request.POST.get('drop_score', 0)), '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,
...@@ -148,6 +148,7 @@ class TopicUpdateOrCreateView(APIView): ...@@ -148,6 +148,7 @@ class TopicUpdateOrCreateView(APIView):
'body_esthetics_tag_ids': body_esthetics_tag_ids, 'body_esthetics_tag_ids': body_esthetics_tag_ids,
'product_id': request.POST.get('product_id'), 'product_id': request.POST.get('product_id'),
'have_face': int(request.POST.get('have_face', 0)), 'have_face': int(request.POST.get('have_face', 0)),
'is_finished': int(request.POST.get('is_finished', 1)),
} }
try: try:
self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap() self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap()
......
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