Commit 7c9f8bed authored by Davve's avatar Davve

修复错误

parent e1f10e9d
......@@ -41,7 +41,6 @@ class TopicUpdateOrCreateView(APIView):
posting_time = analysis_time(request.POST.get('posting_time', 0))
topic_images = list(map(lambda x: x[:-2], json.loads(request.POST.get('topic_images', []))))
data = {
'topic_images': topic_images,
# 'reply_ids': json.loads(request.POST.get('topic_ids', '')),
......@@ -69,7 +68,7 @@ class ReplyUpdateOrCreateView(APIView):
offset = int(request.GET.get('page', 0))
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
filter.update({'topic_id': id})
filter.update({'topic_id': id, 'is_online': 1})
try:
data = self.rpc['venus/sun/topic/reply/list'](offset=(offset-1) * limit, limit=limit, filters=filter).unwrap()
except Exception as e:
......@@ -79,7 +78,7 @@ class ReplyUpdateOrCreateView(APIView):
def post(self, request):
reply_ids = json.loads(request.POST.get('reply_ids', []))
try:
self.rpc['venus/sun/topic/reply/batch_delete'](data=reply_ids).unwrap()
self.rpc['venus/sun/topic/reply/batch_delete'](ids=reply_ids).unwrap()
except Exception as e:
raise e
return {
......
......@@ -33,8 +33,10 @@ class UserUpdateOrCreate(APIView):
def post(self, request):
id = request.POST.get('id', '')
user_id = request.POST.get('user_id', '')
tag_ids = list(set(request.POST.get('tag_ids').split(',')))
user_id = generate_id()
if not user_id:
user_id = generate_id()
data = {
'user_id': user_id,
'is_recommend': request.POST.get('is_recommend'),
......
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