Commit 2cc8d0d0 authored by yangchenglin's avatar yangchenglin

fix

parent c02c9f58
......@@ -50,7 +50,7 @@ class PictorialUpdateOrCreate(APIView):
star_ids = json.loads(request.POST.get('star', '[]'))
pictorial_user_ids = json.loads(request.POST.get('pictorial_user_ids', '[]'))
collection_tag_ids = json.loads(request.POST.get('collection_tag_ids', '[]'))
pictorial_activity_id = request.POST.get('pictorial_activity_id')
pictorial_activity_id = request.POST.get('pictorial_activity_id', 0)
data = {
'name': request.POST.get('name', ''),
'description': request.POST.get('description', ''),
......@@ -65,7 +65,7 @@ class PictorialUpdateOrCreate(APIView):
'add_score': int(request.POST.get('add_score', 0)),
'is_public': True if request.POST.get('is_public') == "true" else False,
'is_feed': int(request.POST.get('is_feed', 0)),
'pictorial_activity_ids': [int(pictorial_activity_id) if pictorial_activity_id else None]
'pictorial_activity_ids': [int(pictorial_activity_id)]
}
try:
......
......@@ -48,6 +48,8 @@ class TagUpdateOrCreateView(APIView):
return {'data': data}
def post(self, request):
import ipdb
ipdb.set_trace()
id = request.POST.get('id')
down_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('down_tags', '[]'))))))
up_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('up_tags', '[]'))))))
......@@ -65,7 +67,7 @@ class TagUpdateOrCreateView(APIView):
'alias': request.POST.get('alias', ''),
'is_show_in_register': request.POST.get('is_show_in_register', 'false'),
'pictorial_ids': list(
(map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorials', '[]'))))))
(map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorial_ids', '[]'))))))
}
try:
data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap()
......
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