diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-04-01 23:40:59 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-04-01 23:40:59 +0200 |
commit | 12562beb084462f00f5786843bf56b3ec45f2b30 (patch) | |
tree | 21a83e4136a28f365a464d990bd5e314ab6e69f5 | |
parent | Test if the id of the feed is valid. (diff) | |
download | newspipe-12562beb084462f00f5786843bf56b3ec45f2b30.tar.gz newspipe-12562beb084462f00f5786843bf56b3ec45f2b30.tar.bz2 newspipe-12562beb084462f00f5786843bf56b3ec45f2b30.zip |
If feed id is not valid, return directly the error page.
-rwxr-xr-x | source/pyAggr3g470r.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 297c05a1..1c2009fe 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -269,6 +269,8 @@ class pyAggr3g470r(object): """ try: feed = self.mongo.get_feed(feed_id) + if feed == None: + return self.error("<p>This feed do not exists.</p>") articles = self.mongo.get_articles(feed_id, limit=10) nb_articles_feed = self.mongo.nb_articles(feed_id) nb_articles_total = self.mongo.nb_articles() @@ -277,8 +279,7 @@ class pyAggr3g470r(object): nb_favorites = self.mongo.nb_favorites(feed_id) except KeyError: return self.error("<p>This feed do not exists.</p>") - if feed == None: - return self.error("<p>This feed do not exists.</p>") + if articles.count() != 0: today = datetime.datetime.now() |