From 7983105c58d24af3faf5b862dd122ccc6d593bf7 Mon Sep 17 00:00:00 2001 From: freamon Date: Thu, 17 Oct 2024 18:56:06 +0000 Subject: [PATCH] post-reply soft-deletion: comment out uncalled routine --- app/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models.py b/app/models.py index 38f67f19..2779d2f0 100644 --- a/app/models.py +++ b/app/models.py @@ -1513,9 +1513,18 @@ class PostReply(db.Model): return parent.author.public_url() def delete_dependencies(self): + """ + The first loop doesn't seem to ever be invoked with the current behaviour. + For replies with their own replies: functions which deal with removal don't set reply.deleted and don't call this, and + because reply.deleted isn't set, the cli task 7 days later doesn't call this either. + + The plan is to set reply.deleted whether there's child replies or not (as happens with the API call), so I've commented + it out so the current behaviour isn't changed. + for child_reply in self.child_replies(): child_reply.delete_dependencies() db.session.delete(child_reply) + """ db.session.query(PostReplyBookmark).filter(PostReplyBookmark.post_reply_id == self.id).delete() db.session.query(Report).filter(Report.suspect_post_reply_id == self.id).delete()