empty post replies when purging

This commit is contained in:
rimu 2024-02-09 12:52:16 +13:00
parent 6ceefd8dd3
commit 6cf59b1c3a
2 changed files with 4 additions and 0 deletions

View file

@ -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')))

View file

@ -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()