Commit 1d460986 authored by 许俊鹏's avatar 许俊鹏

合并批量修改帖子的方法

parent c195ddac
......@@ -110,24 +110,6 @@ class ReplyCreate(APIView):
class TopicListBatchUpdate(APIView):
def post(self, request):
ids = request.POST.get('ids', '').split()
type = request.POST.get('type')
updates = {}
if type == 'offline':
updates['is_online'] = False
else:
updates['is_online'] = True
try:
self.rpc['venus/sun/topic/batch/update'](updates=updates, ids=ids).unwrap()
except Exception as e:
error_logger.error(u'批量更新帖子失败%s', e)
raise
return {
"message": "更新成功"
}
class TopicListBatchUpdate_new(APIView):
def post(self, request):
ids = request.POST.get('ids', '').split()
......@@ -140,4 +122,3 @@ class TopicListBatchUpdate_new(APIView):
return {
"message": "更新成功"
}
......@@ -55,7 +55,6 @@ urlpatterns = [
url(r'^topic/reply/list$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/batch_delete$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/create$', ReplyCreate.as_view()),
url(r'^topic/batch_update_new$', TopicListBatchUpdate_new.as_view()), # TODO 后台优化临时需求, 1.2 上线后与topic/batch_update 整合到一起
# star相关
url(r'^celebrity/list$', CelebrityListView.as_view()),
......
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