aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-13 08:12:10 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-13 08:12:10 +0200
commit6eb4f8aed692c0db63f415743300d10b63d95720 (patch)
tree9df78fd2def42d14a9e6c4daac6b0e2a1d97d29e
parentrevert last change (diff)
downloadnewspipe-6eb4f8aed692c0db63f415743300d10b63d95720.tar.gz
newspipe-6eb4f8aed692c0db63f415743300d10b63d95720.tar.bz2
newspipe-6eb4f8aed692c0db63f415743300d10b63d95720.zip
We should filter articles only for one user.
-rw-r--r--pyaggr3g470r/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index c8ed0b79..56dc19ad 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -214,7 +214,8 @@ def signup():
@login_required
def home():
feeds = {feed.id: feed.title for feed in g.user.feeds if feed.enabled}
- articles = Article.query.filter(Article.feed_id.in_(feeds.keys()))
+ articles = Article.query.filter(Article.feed_id.in_(feeds.keys()),
+ Article.user_id == g.user.id)
filter_ = request.args.get('filter_', 'unread')
feed_id = int(request.args.get('feed', 0))
limit = request.args.get('limit', 1000)
@@ -228,7 +229,7 @@ def home():
limit = int(limit)
articles = articles.limit(limit)
unread = db.session.query(Article.feed_id, func.count(Article.id))\
- .filter(Article.readed == False)\
+ .filter(Article.readed == False, Article.user_id == g.user.id)\
.group_by(Article.feed_id).all()
def gen_url(filter_=filter_, limit=limit, feed=feed_id):
return '/?filter_=%s&limit=%s&feed=%d' % (filter_, limit, feed)
bgstack15