[Fix] Sync Delete Reply when delete Post

This commit is contained in:
Harry-zklcdc 2020-07-31 20:33:01 +08:00
parent 8f15bc8639
commit eac68443bf

View File

@ -92,8 +92,10 @@ class ForumPostAPI(APIView):
forumpost = ForumPost.objects.get(id=request.GET["forumpost_id"])
if str(username) == str(forumpost.author):
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
ForumReply.objects.filter(fa_id=request.GET["forumpost_id"]).delete()
elif admin_type == "Super Admin":
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
ForumReply.objects.filter(fa_id=request.GET["forumpost_id"]).delete()
else:
return self.error("Username doesn't match")
return self.success()