diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-02-09 22:29:34 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-02-09 22:29:34 +0100 |
commit | 48fe591bb57249e2fc773d296d5fb17762274d75 (patch) | |
tree | eae9b23b194c4484f7a62a1ab8c8ac9039824ec1 | |
parent | Updated redirection for delete_feed view. (diff) | |
download | newspipe-48fe591bb57249e2fc773d296d5fb17762274d75.tar.gz newspipe-48fe591bb57249e2fc773d296d5fb17762274d75.tar.bz2 newspipe-48fe591bb57249e2fc773d296d5fb17762274d75.zip |
Catch error if not articles for a feed (when detecting inactive feeds).
-rw-r--r-- | pyaggr3g470r/views.py | 5 |
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)) |