aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-02-09 22:29:34 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-02-09 22:29:34 +0100
commit48fe591bb57249e2fc773d296d5fb17762274d75 (patch)
treeeae9b23b194c4484f7a62a1ab8c8ac9039824ec1 /pyaggr3g470r/views.py
parentUpdated redirection for delete_feed view. (diff)
downloadnewspipe-48fe591bb57249e2fc773d296d5fb17762274d75.tar.gz
newspipe-48fe591bb57249e2fc773d296d5fb17762274d75.tar.bz2
newspipe-48fe591bb57249e2fc773d296d5fb17762274d75.zip
Catch error if not articles for a feed (when detecting inactive feeds).
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py5
1 files changed, 4 insertions, 1 deletions
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))
bgstack15