aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-26 15:09:48 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-26 15:09:48 +0100
commit23ac58d245d7c789939ee520f27e8c1a32cae41c (patch)
tree190d54751546c83dcbdf5c3c3e1c0f60c127a756
parentIf it is not possible to get the real URL, uses the URL provided by feedparser. (diff)
downloadnewspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.tar.gz
newspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.tar.bz2
newspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.zip
Only append the article to list if the saving with MongoEngine has been successful.
-rw-r--r--pyaggr3g470r/feedgetter.py5
1 files changed, 4 insertions, 1 deletions
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
bgstack15