From ece7c8d5fcf5d91e8ff68b9023f73eeac6f20279 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 20 Jan 2013 09:56:32 +0100 Subject: get_feed() in mongodb.py should test the presence of a collection. --- source/mongodb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/mongodb.py b/source/mongodb.py index a8d81aef..358b2746 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -76,7 +76,10 @@ class Articles(object): """ Return information about a feed. """ - return next(self.db[str(feed_id)].find()) + try: + return next(self.db[str(feed_id)].find()) + except: + return None def get_all_feeds(self, condition=None): """ -- cgit