From 48fe591bb57249e2fc773d296d5fb17762274d75 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 9 Feb 2014 22:29:34 +0100 Subject: Catch error if not articles for a feed (when detecting inactive feeds). --- pyaggr3g470r/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 19e52ee3..1118c223 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -314,7 +314,10 @@ def inactives(): today = datetime.datetime.now() inactives = [] for feed in user.feeds: - last_post = feed.articles[0].date + try: + last_post = feed.articles[0].date + except IndexError: + continue elapsed = today - last_post if elapsed > datetime.timedelta(days=nb_days): inactives.append((feed, elapsed)) -- cgit