Commit 606bcbb4 authored by haowang's avatar haowang

fix code

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