From 771a6610fd0653c8f5248e19b9ca70e5fa8c9126 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 18 Apr 2016 14:28:10 +0200 Subject: models.Article is not imported here... --- src/web/views/home.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/web/views/home.py b/src/web/views/home.py index dfda381a..f53299dc 100644 --- a/src/web/views/home.py +++ b/src/web/views/home.py @@ -97,6 +97,11 @@ def _get_filters(in_dict): @jsonify def _articles_to_json(articles, fd_hash=None): now, locale = datetime.now(), get_locale() + fd_hash = {feed.id: {'title': feed.title, + 'icon_url': url_for('icon.icon', url=feed.icon_url) + if feed.icon_url else None} + for feed in FeedController(current_user.id).read()} + return {'articles': [{'title': art.title, 'liked': art.like, 'read': art.readed, 'article_id': art.id, 'selected': False, 'feed_id': art.feed_id, 'category_id': art.category_id or 0, @@ -115,12 +120,8 @@ def _articles_to_json(articles, fd_hash=None): def get_middle_panel(): filters = _get_filters(request.args) art_contr = ArticleController(current_user.id) - fd_hash = {feed.id: {'title': feed.title, - 'icon_url': url_for('icon.icon', url=feed.icon_url) - if feed.icon_url else None} - for feed in FeedController(current_user.id).read()} - articles = art_contr.read(**filters).order_by(Article.date.desc()) - return _articles_to_json(articles, fd_hash) + articles = art_contr.read_light(**filters) + return _articles_to_json(articles) @current_app.route('/getart/') -- cgit