From 6cf59b1c3a0545bbab6e74e4b3186702427b7501 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:52:16 +1300 Subject: [PATCH] empty post replies when purging --- app/cli.py | 1 + app/models.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/cli.py b/app/cli.py index 88b88dd8..ed2b024b 100644 --- a/app/cli.py +++ b/app/cli.py @@ -74,6 +74,7 @@ def register(app): db.session.add(BannedInstances(domain='pieville.net')) db.session.add(BannedInstances(domain='noauthority.social')) db.session.add(BannedInstances(domain='pieville.net')) + db.session.add(BannedInstances(domain='links.hackliberty.org')) interests = file_get_contents('interests.txt') db.session.add(Interest(name='🕊 Chilling', communities=parse_communities(interests, 'chilling'))) db.session.add(Interest(name='💭 Interesting stuff', communities=parse_communities(interests, 'interesting stuff'))) diff --git a/app/models.py b/app/models.py index 821edd90..d754092e 100644 --- a/app/models.py +++ b/app/models.py @@ -599,6 +599,9 @@ class User(UserMixin, db.Model): post.delete_dependencies() post.flush_cache() db.session.delete(post) + post_replies = PostReply.query.filter_by(user_id=self.id).all() + for reply in post_replies: + reply.body = reply.body_html = reply.body_html_safe = '' db.session.commit()