diff --git a/app/models.py b/app/models.py index 2e903196..795e059f 100644 --- a/app/models.py +++ b/app/models.py @@ -631,6 +631,7 @@ class Community(db.Model): db.session.query(CommunityJoinRequest).filter(CommunityJoinRequest.community_id == self.id).delete() db.session.query(CommunityMember).filter(CommunityMember.community_id == self.id).delete() db.session.query(Report).filter(Report.suspect_community_id == self.id).delete() + db.session.query(ModLog).filter(ModLog.community_id == self.id).delete() user_role = db.Table('user_role', @@ -1021,6 +1022,7 @@ class User(UserMixin, db.Model): db.session.query(PollChoiceVote).filter(PollChoiceVote.user_id == self.id).delete() db.session.query(PostBookmark).filter(PostBookmark.user_id == self.id).delete() db.session.query(PostReplyBookmark).filter(PostReplyBookmark.user_id == self.id).delete() + db.session.query(ModLog).filter(ModLog.user_id == self.id).delete() def purge_content(self, soft=True): files = File.query.join(Post).filter(Post.user_id == self.id).all()