Commit e0438c35 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/topic_finish' into 'master'

Ycl/topic finish

See merge request alpha/sun!329
parents 481e2786 794c2c0b
......@@ -28,6 +28,8 @@ class TopicListView(APIView):
filters.update({'drop_score': int(drop_score)})
elif int(drop_score) == 1:
filters.update({'drop_score__exclude': int(drop_score)})
if filters.get("is_finished") is not None:
filters["is_finished"] = True if filters.get("is_finished") else False
res = self.rpc['physical/search/business/topic'](
offset=(page-1) * limit,
......@@ -121,7 +123,6 @@ class TopicUpdateOrCreateView(APIView):
topic_images = list(map(lambda x: x[:-2], json.loads(request.POST.get('topic_images', '[]'))))
tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('tags', '[]'))))
collection_tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('collection_tags', '[]'))))
cut_word_tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('cut_word_tags', '[]'))))
body_esthetics_tag_ids = list(
map(lambda x: x.split(':')[0], json.loads(request.POST.get('body_esthetics_tags', '[]'))))
pictorial_ids = list(json.loads(request.POST.get('pictorial_ids', '[]')))
......@@ -137,7 +138,6 @@ class TopicUpdateOrCreateView(APIView):
'star_id': request.POST.get('star', '').split(':')[0],
'tag_ids': tag_ids,
'collection_tag_ids': collection_tag_ids,
'cut_word_tag_ids': cut_word_tag_ids,
'is_online': int(request.POST.get('is_online', 0)),
'drop_score': int(request.POST.get('drop_score', 0)),
'has_image': 1 if topic_images else 0,
......@@ -146,6 +146,7 @@ class TopicUpdateOrCreateView(APIView):
'is_home': int(request.POST.get('is_home', 0)),
'is_recommend': int(request.POST.get('is_recommend', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids,
'is_finished': int(request.POST.get('is_finished', 1)),
}
try:
self.rpc['venus/sun/topic/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