From 5b953122c3ccf24f299bf52402988753c02577d1 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 7 Aug 2017 14:15:08 +0200 Subject: [PATCH] fix crash when tweets have been deleted oob --- lib/twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twitter.py b/lib/twitter.py index 1de464d..a9d1d8c 100644 --- a/lib/twitter.py +++ b/lib/twitter.py @@ -126,7 +126,7 @@ def refresh_posts(posts): for post in posts: tweet = next((tweet for tweet in tweets if tweet['id_str'] == post.twitter_id), None) if not tweet: - session.delete(post) + db.session.delete(post) else: post = db.session.merge(post_from_api_tweet_object(tweet)) refreshed_posts.append(post)