From eac68443bfae735f49bc1dae01a176db807685a6 Mon Sep 17 00:00:00 2001 From: Harry-zklcdc <1269158832@qq.com> Date: Fri, 31 Jul 2020 20:33:01 +0800 Subject: [PATCH] [Fix] Sync Delete Reply when delete Post --- forum/views/oj.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/forum/views/oj.py b/forum/views/oj.py index a0d8cfa3..626504fc 100644 --- a/forum/views/oj.py +++ b/forum/views/oj.py @@ -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()