aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/views.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-05-28 15:27:21 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-07-02 15:34:16 +0200
commitbe33517445c787be0da5577da048d4b2d91452d4 (patch)
tree68f281bfb9464f52ea3db18510967613db686545 /pyaggr3g470r/views/views.py
parentaccelerating the feeds page (diff)
downloadnewspipe-be33517445c787be0da5577da048d4b2d91452d4.tar.gz
newspipe-be33517445c787be0da5577da048d4b2d91452d4.tar.bz2
newspipe-be33517445c787be0da5577da048d4b2d91452d4.zip
adding unread count when listing feeds, using count_by_feed for user management
Diffstat (limited to 'pyaggr3g470r/views/views.py')
-rw-r--r--pyaggr3g470r/views/views.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index e0bd1dcb..a4e799cc 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -736,9 +736,14 @@ def user(user_id=None):
"""
See information about a user (stations, etc.).
"""
- user = User.query.filter(User.id == user_id).first()
+ user = UserController().get(id=user_id)
if user is not None:
- return render_template('/admin/user.html', user=user)
+ article_contr = ArticleController(user_id)
+ return render_template('/admin/user.html', user=user,
+ article_count=article_contr.count_by_feed(),
+ unread_article_count=article_contr.count_by_feed(readed=False),
+ )
+
else:
flash(gettext('This user does not exist.'), 'danger')
return redirect(redirect_url())
bgstack15