mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
only auto-delete non-sticky posts
This commit is contained in:
parent
64a6180a13
commit
589ee8413a
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ def register(app):
|
|||
communities = Community.query.filter(Community.content_retention > 0).all()
|
||||
for community in communities:
|
||||
cut_off = utcnow() - timedelta(days=community.content_retention)
|
||||
db.session.execute(text('UPDATE "post" SET deleted = true WHERE posted_at < :cut_off AND community_id = :community_id'), {
|
||||
db.session.execute(text('UPDATE "post" SET deleted = true WHERE sticky = false AND posted_at < :cut_off AND community_id = :community_id'), {
|
||||
'cut_off': cut_off,
|
||||
'community_id': community.id
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue