Commit 38a7e78f authored by haowang's avatar haowang

fix code

parent 1f959cb2
...@@ -153,13 +153,13 @@ class PictorialProductAdd(APIView): ...@@ -153,13 +153,13 @@ class PictorialProductAdd(APIView):
"""画报添加商品关系""" """画报添加商品关系"""
def post(self, request): def post(self, request):
id_ = request.POST.get('id') ids = request.POST.get('ids', '[]')
product_id = request.POST.get('product_id') product_id = request.POST.get('product_id')
try: try:
self.rpc['venus/sun/pictorial/add_product'](id_=id_, product_id=product_id).unwrap() self.rpc['venus/sun/pictorial/add_product'](ids=ids, product_id=product_id).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'编辑%s画报信息失败%s' % (id_, e)) error_logger.error(u'编辑%s画报信息失败%s' % (ids, e))
raise raise
return { return {
'message': '更新成功' 'message': '更新成功'
...@@ -170,13 +170,13 @@ class PictorialProductDel(APIView): ...@@ -170,13 +170,13 @@ class PictorialProductDel(APIView):
"""画报删除商品关系""" """画报删除商品关系"""
def post(self, request): def post(self, request):
id_ = request.POST.get('id') ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id') product_id = request.POST.get('product_id')
try: try:
self.rpc['venus/sun/pictorial/del_product'](id_=id_, product_id=product_id).unwrap() self.rpc['venus/sun/pictorial/del_product'](ids=ids, product_id=product_id).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'编辑%s画报信息失败%s' % (id_, e)) error_logger.error(u'编辑%s画报信息失败%s' % (ids, e))
raise raise
return { return {
'message': '更新成功' 'message': '更新成功'
......
...@@ -251,13 +251,13 @@ class TopicProductAdd(APIView): ...@@ -251,13 +251,13 @@ class TopicProductAdd(APIView):
"""帖子添加商品关系""" """帖子添加商品关系"""
def post(self, request): def post(self, request):
id_ = request.POST.get('id') ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id') product_id = request.POST.get('product_id')
try: try:
self.rpc['venus/sun/topic/add_product'](id_=id_, product_id=product_id).unwrap() self.rpc['venus/sun/topic/add_product'](ids=ids, product_id=product_id).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'编辑%s帖子信息失败%s' % (id_, e)) error_logger.error(u'编辑%s帖子信息失败%s' % (ids, e))
raise raise
return { return {
'message': '更新成功' 'message': '更新成功'
...@@ -268,13 +268,13 @@ class TopicProductDel(APIView): ...@@ -268,13 +268,13 @@ class TopicProductDel(APIView):
"""帖子删除商品关系""" """帖子删除商品关系"""
def post(self, request): def post(self, request):
id_ = request.POST.get('id') ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id') product_id = request.POST.get('product_id')
try: try:
self.rpc['venus/sun/topic/del_product'](id_=id_, product_id=product_id).unwrap() self.rpc['venus/sun/topic/del_product'](ids=ids, product_id=product_id).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'编辑%s帖子信息失败%s' % (id_, e)) error_logger.error(u'编辑%s帖子信息失败%s' % (ids, e))
raise raise
return { return {
'message': '更新成功' 'message': '更新成功'
......
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