Commit 417fe632 authored by haowang's avatar haowang

fix api params to json

parent 13353ac3
......@@ -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