dont delete the drafts themselves:

-- ppl can unabandon their effortposts more than 6 months later
-- ppl cant see their deleted content on wpd
master
Aevann 2024-10-26 00:59:26 +03:00
parent a8db05e1dc
commit 7edf9b0e43
1 changed files with 8 additions and 10 deletions

View File

@ -450,20 +450,18 @@ def _cleanup_videos():
)
for post in unpublished_drafts:
print(f'draft post: {post.id}', flush=True)
post.deleted_utc = time.time()
g.db.add(post)
for media_usage in post.media_usages:
if not media_usage.removed_utc:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.deleted_utc = post.deleted_utc
media_usage.removed_utc = time.time()
g.db.add(media_usage)
for comment in post.comments:
print(f'draft comment: {comment.id}', flush=True)
comment.deleted_utc = time.time()
g.db.add(comment)
for media_usage in comment.media_usages:
if not media_usage.removed_utc:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.deleted_utc = comment.deleted_utc
media_usage.removed_utc = time.time()
g.db.add(media_usage)