Commit 50348b96 authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

fix code

See merge request alpha/sun!254
parents 72f0eed4 36080ab6
......@@ -55,16 +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()
if classify_infos:
data['classify_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in classify_infos]
else:
data['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()
if category_infos:
data['category_infos'] = [{'id': obj.get('id'), 'cn_name': obj.get('cn_name')} for obj in category_infos]
else:
data['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