diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-21 19:33:28 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-21 19:33:28 +0100 |
commit | a059e00533bb4e6ee8955e1c906ccd71115c014c (patch) | |
tree | a3e960afffe82cb0765254bf851dea9d20eea838 /source/mongodb.py | |
parent | Update revesion date for feedgetter.py. (diff) | |
download | newspipe-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.py | 5 |
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): """ |