diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-26 15:09:48 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-26 15:09:48 +0100 |
commit | 23ac58d245d7c789939ee520f27e8c1a32cae41c (patch) | |
tree | 190d54751546c83dcbdf5c3c3e1c0f60c127a756 /pyaggr3g470r | |
parent | If it is not possible to get the real URL, uses the URL provided by feedparser. (diff) | |
download | newspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.tar.gz newspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.tar.bz2 newspipe-23ac58d245d7c789939ee520f27e8c1a32cae41c.zip |
Only append the article to list if the saving with MongoEngine has been successful.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/feedgetter.py | 5 |
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 |