Browse Source

Deleted post cleanup: check is_deleted

This shouldn't make much difference in practice since deleted_time
should be updated automatically, but it's probably safest to make sure
that the posts are still deleted before cleaning them up, in case the
deleted_time ends up staying set somehow.
merge-requests/53/head
Deimos 6 years ago
parent
commit
a866a0c38e
  1. 2
      tildes/scripts/clean_private_data.py

2
tildes/scripts/clean_private_data.py

@ -87,6 +87,7 @@ class DataCleaner:
updated = (
self.db_session.query(Comment)
.filter(
Comment.is_deleted == True, # noqa
Comment.deleted_time <= self.retention_cutoff, # type: ignore
Comment.user_id != 0,
)
@ -113,6 +114,7 @@ class DataCleaner:
updated = (
self.db_session.query(Topic)
.filter(
Topic.is_deleted == True, # noqa
Topic.deleted_time <= self.retention_cutoff, # type: ignore
Topic.user_id != 0,
)

Loading…
Cancel
Save