Commit bf53e2ef authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'master'

fix api params to json

See merge request !186
parents b73eac41 417fe632
......@@ -79,7 +79,7 @@ class BatchCreateTopicWithAiFashionTag(APIView):
def post(self, request):
json_file = request.FILES.get('file')
tag_infos = request.POST.get('tag_infos')
tag_infos = request.POST.get('tag_infos', '[]')
if not json_file and not tag_infos:
return {'message': u'上传失败,请重新上传', 'code': 500}
......@@ -87,6 +87,7 @@ class BatchCreateTopicWithAiFashionTag(APIView):
json_data = json.load(json_file)
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=json_data).unwrap()
if tag_infos:
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=tag_infos).unwrap()
json_data = json.load(tag_infos)
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=json_data).unwrap()
return {'message': u'上传成功', 'code': 200}
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