Commit 1c8e40d4 authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

fix code

See merge request alpha/sun!266
parents 9a9c432e 38a7e78f
......@@ -153,13 +153,13 @@ class PictorialProductAdd(APIView):
"""画报添加商品关系"""
def post(self, request):
id_ = request.POST.get('id')
ids = request.POST.get('ids', '[]')
product_id = request.POST.get('product_id')
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:
error_logger.error(u'编辑%s画报信息失败%s' % (id_, e))
error_logger.error(u'编辑%s画报信息失败%s' % (ids, e))
raise
return {
'message': '更新成功'
......@@ -170,13 +170,13 @@ class PictorialProductDel(APIView):
"""画报删除商品关系"""
def post(self, request):
id_ = request.POST.get('id')
ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id')
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:
error_logger.error(u'编辑%s画报信息失败%s' % (id_, e))
error_logger.error(u'编辑%s画报信息失败%s' % (ids, e))
raise
return {
'message': '更新成功'
......
......@@ -251,13 +251,13 @@ class TopicProductAdd(APIView):
"""帖子添加商品关系"""
def post(self, request):
id_ = request.POST.get('id')
ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id')
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:
error_logger.error(u'编辑%s帖子信息失败%s' % (id_, e))
error_logger.error(u'编辑%s帖子信息失败%s' % (ids, e))
raise
return {
'message': '更新成功'
......@@ -268,13 +268,13 @@ class TopicProductDel(APIView):
"""帖子删除商品关系"""
def post(self, request):
id_ = request.POST.get('id')
ids = json.loads(request.POST.get('ids', '[]'))
product_id = request.POST.get('product_id')
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:
error_logger.error(u'编辑%s帖子信息失败%s' % (id_, e))
error_logger.error(u'编辑%s帖子信息失败%s' % (ids, e))
raise
return {
'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