aboutsummaryrefslogtreecommitdiff
path: root/source/mongodb.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-01-21 19:33:28 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-01-21 19:33:28 +0100
commita059e00533bb4e6ee8955e1c906ccd71115c014c (patch)
treea3e960afffe82cb0765254bf851dea9d20eea838 /source/mongodb.py
parentUpdate revesion date for feedgetter.py. (diff)
downloadnewspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.tar.gz
newspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.tar.bz2
newspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.zip
Test if the article is present in the database before sending it via mail.
Diffstat (limited to 'source/mongodb.py')
-rw-r--r--source/mongodb.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/mongodb.py b/source/mongodb.py
index 7879adee..93894154 100644
--- a/source/mongodb.py
+++ b/source/mongodb.py
@@ -131,7 +131,10 @@ class Articles(object):
elif feed_id != None and article_id != None:
# Return a precise article.
collection = self.db[str(feed_id)]
- return next(collection.find({"article_id":article_id}))
+ try:
+ return next(collection.find({"article_id":article_id}))
+ except:
+ return False
def get_favorites(self, feed_id=None):
"""
bgstack15