fix twitter when all refreshed posts are gone

This commit is contained in:
codl 2017-08-29 17:50:19 +02:00
parent 20ed4175e4
commit 9a86b45268
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 6 additions and 5 deletions

View File

@ -186,6 +186,7 @@ def delete_from_account(account_id):
if account.service == 'twitter':
action = lib.twitter.delete
posts = refresh_posts(posts)
if posts:
eligible = random.choice(list( # nosec
(post for post in posts if
(not account.policy_keep_favourites or not post.favourite)