mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
[Fix] Sync Delete Reply when delete Post
This commit is contained in:
parent
8f15bc8639
commit
eac68443bf
@ -92,8 +92,10 @@ class ForumPostAPI(APIView):
|
|||||||
forumpost = ForumPost.objects.get(id=request.GET["forumpost_id"])
|
forumpost = ForumPost.objects.get(id=request.GET["forumpost_id"])
|
||||||
if str(username) == str(forumpost.author):
|
if str(username) == str(forumpost.author):
|
||||||
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
|
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
|
||||||
|
ForumReply.objects.filter(fa_id=request.GET["forumpost_id"]).delete()
|
||||||
elif admin_type == "Super Admin":
|
elif admin_type == "Super Admin":
|
||||||
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
|
ForumPost.objects.filter(id=request.GET["forumpost_id"]).delete()
|
||||||
|
ForumReply.objects.filter(fa_id=request.GET["forumpost_id"]).delete()
|
||||||
else:
|
else:
|
||||||
return self.error("Username doesn't match")
|
return self.error("Username doesn't match")
|
||||||
return self.success()
|
return self.success()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user