mirror of
https://github.com/codl/forget
synced 2025-01-07 04:41:44 +01:00
fix crash when tweets have been deleted oob
This commit is contained in:
parent
1ba30bdb0a
commit
5b953122c3
@ -126,7 +126,7 @@ def refresh_posts(posts):
|
|||||||
for post in posts:
|
for post in posts:
|
||||||
tweet = next((tweet for tweet in tweets if tweet['id_str'] == post.twitter_id), None)
|
tweet = next((tweet for tweet in tweets if tweet['id_str'] == post.twitter_id), None)
|
||||||
if not tweet:
|
if not tweet:
|
||||||
session.delete(post)
|
db.session.delete(post)
|
||||||
else:
|
else:
|
||||||
post = db.session.merge(post_from_api_tweet_object(tweet))
|
post = db.session.merge(post_from_api_tweet_object(tweet))
|
||||||
refreshed_posts.append(post)
|
refreshed_posts.append(post)
|
||||||
|
Loading…
Reference in New Issue
Block a user