From 23ac58d245d7c789939ee520f27e8c1a32cae41c Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 26 Dec 2013 15:09:48 +0100 Subject: Only append the article to list if the saving with MongoEngine has been successful. --- pyaggr3g470r/feedgetter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py index d3195fb0..7b157211 100644 --- a/pyaggr3g470r/feedgetter.py +++ b/pyaggr3g470r/feedgetter.py @@ -131,7 +131,10 @@ class FeedGetter(object): # save the article article = models.Article(post_date, real_url, article_title, description, False, False) - article.save() + try: + article.save() + except: + continue articles.append(article) # add the article to the Whoosh index -- cgit