diff options
Diffstat (limited to 'src/web')
-rw-r--r-- | src/web/forms.py | 3 | ||||
-rw-r--r-- | src/web/views/__init__.py | 1 | ||||
-rw-r--r-- | src/web/views/admin.py | 2 | ||||
-rw-r--r-- | src/web/views/user.py | 1 | ||||
-rw-r--r-- | src/web/views/views.py | 2 |
5 files changed, 6 insertions, 3 deletions
diff --git a/src/web/forms.py b/src/web/forms.py index 905a0b2a..59a7bde5 100644 --- a/src/web/forms.py +++ b/src/web/forms.py @@ -163,7 +163,8 @@ class ProfileForm(Form): refresh_rate = IntegerField(lazy_gettext("Feeds refresh frequency " "(in minutes)"), default=60) - is_public_profile = BooleanField(lazy_gettext("Public profile"), default=True) + is_public_profile = BooleanField(lazy_gettext("Public profile"), + default=True) submit = SubmitField(lazy_gettext("Save")) def validate(self): 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) |