Commit 2b99cb98 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/kyc_pictorial' into 'test'

Ycl/kyc pictorial

See merge request alpha/sun!222
parents e2e172ae 19e9629f
......@@ -27,17 +27,21 @@ class WordParentInfoView(APIView):
class WordParentCreateView(APIView):
def post(self, request):
name = request.POST.get('name', None)
children_words = json.loads(request.POST.get('children_words', '[]'))
content_ad = request.POST.get('content_ad', '')
makeup_ad = request.POST.get('makeup_ad', '')
dress_ad = request.POST.get('dress_ad', '')
gender = request.POST.get('gender', 0)
if not name:
return r'缺少参数'
data = self.rpc['venus/sun/word_parent/add'](name=name, children_words=children_words, content_ad=content_ad, makeup_ad=makeup_ad, dress_ad=dress_ad, gender=gender).unwrap()
data = {}
data["name"] = request.POST.get('name', None)
children_words = request.POST.get('children_words')
data["children_words"] = json.loads(children_words) if children_words else []
data["content_ad"] = request.POST.get('content_ad', None)
data["makeup_ad"] = request.POST.get('makeup_ad', None)
data["dress_ad"] = request.POST.get('dress_ad', None)
data["gender"] = request.POST.get('gender', None)
makeup_pictorial_ids = request.POST.get('makeup_pictorial_ids')
clothing_pictorial_ids = request.POST.get('clothing_pictorial_ids')
data["makeup_pictorial_ids"] = json.loads(makeup_pictorial_ids) if makeup_pictorial_ids else []
data["clothing_pictorial_ids"] = json.loads(clothing_pictorial_ids) if clothing_pictorial_ids else []
data = self.rpc['venus/sun/word_parent/add'](data=data).unwrap()
return data
......@@ -58,7 +62,7 @@ class WordParentUpdateView(APIView):
makeup_pictorial_ids = request.POST.get('makeup_pictorial_ids')
clothing_pictorial_ids = request.POST.get('clothing_pictorial_ids')
data["makeup_pictorial_ids"] = json.loads(makeup_pictorial_ids) if makeup_pictorial_ids else []
data["clothing_pictorial_ids"] = json(clothing_pictorial_ids) if clothing_pictorial_ids else []
data["clothing_pictorial_ids"] = json.loads(clothing_pictorial_ids) if clothing_pictorial_ids else []
data = self.rpc['venus/sun/word_parent/edit'](data=data).unwrap()
if not 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