aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-26 07:47:25 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-26 07:47:25 +0200
commitb049532adfda00de1ab56e9a0869bfed050f632c (patch)
tree8f4f143a601ca43fa890d5c8e0a64a5460ed1907 /src/web/views
parentUpdated about page. (diff)
downloadnewspipe-b049532adfda00de1ab56e9a0869bfed050f632c.tar.gz
newspipe-b049532adfda00de1ab56e9a0869bfed050f632c.tar.bz2
newspipe-b049532adfda00de1ab56e9a0869bfed050f632c.zip
Minor improvements.
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/__init__.py1
-rw-r--r--src/web/views/admin.py2
-rw-r--r--src/web/views/user.py1
-rw-r--r--src/web/views/views.py2
4 files changed, 4 insertions, 2 deletions
diff --git a/src/web/views/__init__.py b/src/web/views/__init__.py
index 1ca5c473..e0e49927 100644
--- a/src/web/views/__init__.py
+++ b/src/web/views/__init__.py
@@ -16,6 +16,7 @@ import conf
from flask import request
from flask import g
+
@g.babel.localeselector
def get_locale():
return request.accept_languages.best_match(conf.LANGUAGES.keys())
diff --git a/src/web/views/admin.py b/src/web/views/admin.py
index 9703894e..493a91c9 100644
--- a/src/web/views/admin.py
+++ b/src/web/views/admin.py
@@ -6,7 +6,7 @@ from werkzeug import generate_password_hash
from web.views.common import admin_permission
from web.lib.utils import redirect_url
-from web.controllers import UserController, ArticleController
+from web.controllers import UserController
from web.forms import InformationMessageForm, UserForm
admin_bp = Blueprint('admin', __name__, url_prefix='/admin')
diff --git a/src/web/views/user.py b/src/web/views/user.py
index df6508f5..541432bb 100644
--- a/src/web/views/user.py
+++ b/src/web/views/user.py
@@ -41,6 +41,7 @@ def profile_public(nickname=None):
feeds=user.feeds,
tag_cloud=tag_cloud)
+
@user_bp.route('/management', methods=['GET', 'POST'])
@login_required
def management():
diff --git a/src/web/views/views.py b/src/web/views/views.py
index ecb4f888..b9db05bf 100644
--- a/src/web/views/views.py
+++ b/src/web/views/views.py
@@ -65,7 +65,7 @@ def popular():
filters = {}
filters['created_date__gt'] = not_added_before
feeds = FeedController().count_by_link(**filters)
- sorted_feeds = sorted(feeds.items(), key=operator.itemgetter(1),
+ sorted_feeds = sorted(list(feeds.items()), key=operator.itemgetter(1),
reverse=True)
return render_template('popular.html', popular=sorted_feeds)
bgstack15