fix twitter when all refreshed posts are gone
This commit is contained in:
parent
20ed4175e4
commit
9a86b45268
11
tasks.py
11
tasks.py
|
@ -186,11 +186,12 @@ def delete_from_account(account_id):
|
||||||
if account.service == 'twitter':
|
if account.service == 'twitter':
|
||||||
action = lib.twitter.delete
|
action = lib.twitter.delete
|
||||||
posts = refresh_posts(posts)
|
posts = refresh_posts(posts)
|
||||||
eligible = random.choice(list( # nosec
|
if posts:
|
||||||
(post for post in posts if
|
eligible = random.choice(list( # nosec
|
||||||
(not account.policy_keep_favourites or not post.favourite)
|
(post for post in posts if
|
||||||
and (not account.policy_keep_media or not post.has_media)
|
(not account.policy_keep_favourites or not post.favourite)
|
||||||
)))
|
and (not account.policy_keep_media or not post.has_media)
|
||||||
|
)))
|
||||||
elif account.service == 'mastodon':
|
elif account.service == 'mastodon':
|
||||||
action = lib.mastodon.delete
|
action = lib.mastodon.delete
|
||||||
for post in posts:
|
for post in posts:
|
||||||
|
|
Loading…
Reference in New Issue