From 07b5371a1a9d1122b4f74680fd1b5e6d4ce0cfe3 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Tue, 6 Sep 2016 00:08:58 -0400 Subject: [PATCH] Fix usage of is_anonymous as a method for new version of flask-login --- realms/modules/search/views.py | 2 +- realms/modules/wiki/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/realms/modules/search/views.py b/realms/modules/search/views.py index 7d74e20..ab48f54 100644 --- a/realms/modules/search/views.py +++ b/realms/modules/search/views.py @@ -11,7 +11,7 @@ blueprint = Blueprint('search', __name__, template_folder='templates') @blueprint.route('/_search') def search(): - if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous(): + if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous: return current_app.login_manager.unauthorized() results = search_engine.wiki(request.args.get('q')) diff --git a/realms/modules/wiki/views.py b/realms/modules/wiki/views.py index 528e29a..8dd0ada 100644 --- a/realms/modules/wiki/views.py +++ b/realms/modules/wiki/views.py @@ -80,7 +80,7 @@ def history(name): @blueprint.route("/_history_data/") def history_data(name): """Ajax provider for paginated history data.""" - if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous(): + if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous: return current_app.login_manager.unauthorized() draw = int(request.args.get('draw', 0)) start = int(request.args.get('start', 0)) @@ -145,7 +145,7 @@ def _partials(imports, sha='HEAD'): @blueprint.route("/_partials") def partials(): - if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous(): + if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous: return current_app.login_manager.unauthorized() return {'partials': _partials(request.args.getlist('imports[]'))}