Commit 36080ab6 authored by haowang's avatar haowang

fix code

parent 7984f3af
...@@ -55,16 +55,10 @@ class BrandInfoView(APIView): ...@@ -55,16 +55,10 @@ class BrandInfoView(APIView):
data = self.rpc['neptune/commodity/brand/info'](id_=id_).unwrap() data = self.rpc['neptune/commodity/brand/info'](id_=id_).unwrap()
classify_infos = self.rpc['neptune/commodity/classify/infos'](brand_id=id_).unwrap() classify_infos = self.rpc['neptune/commodity/classify/infos'](brand_id=id_).unwrap()
if classify_infos: data['classify_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in classify_infos] if classify_infos else []
data['classify_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in classify_infos]
else:
data['classify_infos'] = []
category_ids = self.rpc['neptune/commodity/brand/category_ids'](id_=id_).unwrap() category_ids = self.rpc['neptune/commodity/brand/category_ids'](id_=id_).unwrap()
category_infos = self.rpc['neptune/commodity/category/infos'](ids=category_ids).unwrap() category_infos = self.rpc['neptune/commodity/category/infos'](ids=category_ids).unwrap()
if category_infos: data['category_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in category_infos] if category_infos else []
data['category_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in category_infos]
else:
data['category_infos'] = []
return data return data
......
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