aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/views.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 00:02:09 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 22:23:47 +0100
commit643f4590445928b7ac568b922f1edb6f52765b68 (patch)
tree268570ca5f205dbe0a8f5b13ab8a0b0c7bcc2227 /pyaggr3g470r/views/views.py
parentmulti crawler update (diff)
downloadnewspipe-643f4590445928b7ac568b922f1edb6f52765b68.tar.gz
newspipe-643f4590445928b7ac568b922f1edb6f52765b68.tar.bz2
newspipe-643f4590445928b7ac568b922f1edb6f52765b68.zip
displaying feed errors in ui
Diffstat (limited to 'pyaggr3g470r/views/views.py')
-rw-r--r--pyaggr3g470r/views/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index 66170a77..0f8fc04d 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -52,6 +52,7 @@ from pyaggr3g470r.models import User, Feed, Article, Role
from pyaggr3g470r.decorators import feed_access_required
from pyaggr3g470r.forms import SignupForm, SigninForm, AddFeedForm, \
ProfileForm, InformationMessageForm, RecoverPasswordForm
+from pyaggr3g470r.controllers import FeedController
if not conf.ON_HEROKU:
import pyaggr3g470r.search as fastsearch
@@ -246,11 +247,14 @@ def home():
unread = db.session.query(Article.feed_id, func.count(Article.id))\
.filter(Article.readed == False, Article.user_id == g.user.id)\
.group_by(Article.feed_id).all()
+ in_error = {feed.id: feed.error_count for feed in
+ FeedController(g.user.id).read(error_count__gt=0).all()}
def gen_url(filter_=filter_, limit=limit, feed=feed_id):
return '?filter_=%s&limit=%s&feed=%d' % (filter_, limit, feed)
return render_template('home.html', gen_url=gen_url, feed_id=feed_id,
filter_=filter_, limit=limit, feeds=feeds,
- unread=dict(unread), articles=articles.all())
+ unread=dict(unread), articles=articles.all(),
+ in_error=in_error)
@app.route('/fetch', methods=['GET'])
bgstack15