mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
post-reply soft-deletion: keep current behaviour by not hard-deleting replies that have their own replies
This commit is contained in:
parent
7983105c58
commit
df2dc6e020
1 changed files with 2 additions and 1 deletions
|
@ -195,7 +195,8 @@ def register(app):
|
||||||
for post_reply in PostReply.query.filter(PostReply.deleted == True,
|
for post_reply in PostReply.query.filter(PostReply.deleted == True,
|
||||||
PostReply.posted_at < utcnow() - timedelta(days=7)).all():
|
PostReply.posted_at < utcnow() - timedelta(days=7)).all():
|
||||||
post_reply.delete_dependencies()
|
post_reply.delete_dependencies()
|
||||||
db.session.delete(post_reply)
|
if not post_reply.has_replies():
|
||||||
|
db.session.delete(post_reply)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
for post in Post.query.filter(Post.deleted == True,
|
for post in Post.query.filter(Post.deleted == True,
|
||||||
|
|
Loading…
Add table
Reference in a new issue