From 12562beb084462f00f5786843bf56b3ec45f2b30 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 1 Apr 2013 23:40:59 +0200 Subject: If feed id is not valid, return directly the error page. --- source/pyAggr3g470r.py | 5 +++-- 1 file 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("

This feed do not exists.

") 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("

This feed do not exists.

") - if feed == None: - return self.error("

This feed do not exists.

") + if articles.count() != 0: today = datetime.datetime.now() -- cgit