Commit 7c9f8bed authored by Davve's avatar Davve

修复错误

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