aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyaggr3g470r/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 62f5ae5e..87a0cec4 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -215,7 +215,8 @@ def inactives():
today = datetime.datetime.now()
inactives = []
for feed in user.feeds:
- last_post = feed.articles[0].date
+ last_post = sorted(feed.articles, key=lambda t: t.date,
+reverse=True)[0].date
elapsed = today - last_post
if elapsed > datetime.timedelta(days=nb_days):
inactives.append((feed, elapsed))
@@ -309,4 +310,4 @@ def delete_feed(feed_id=None):
# delete the feed (EmbeddedDocument object)
user.feeds.remove(feed)
user.save()
- return redirect(url_for('home')) \ No newline at end of file
+ return redirect(url_for('home'))
bgstack15