From 9310fe1832c4df1e6918b012cc77f404586f8c32 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Fri, 29 Jan 2016 10:36:28 -0500 Subject: [PATCH] Convert some flask-login user methods to properties --- endpoints/web.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/endpoints/web.py b/endpoints/web.py index bad2a75ef..426a9f041 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -324,7 +324,7 @@ def buildlogs(build_uuid): @route_show_if(features.BILLING) @require_session_login def receipt(): - if not current_user.is_authenticated(): + if not current_user.is_authenticated: abort(401) return @@ -455,7 +455,7 @@ class FlaskAuthorizationProvider(model.oauth.DatabaseAuthorizationProvider): @web.route('/oauth/authorizeapp', methods=['POST']) @csrf_protect def authorize_application(): - if not current_user.is_authenticated(): + if not current_user.is_authenticated: abort(401) return @@ -471,7 +471,7 @@ def authorize_application(): @web.route(app.config['LOCAL_OAUTH_HANDLER'], methods=['GET']) def oauth_local_handler(): - if not current_user.is_authenticated(): + if not current_user.is_authenticated: abort(401) return @@ -484,7 +484,7 @@ def oauth_local_handler(): @web.route('/oauth/denyapp', methods=['POST']) @csrf_protect def deny_application(): - if not current_user.is_authenticated(): + if not current_user.is_authenticated: abort(401) return @@ -509,7 +509,7 @@ def request_authorization_code(): redirect_uri = request.args.get('redirect_uri', None) scope = request.args.get('scope', None) - if (not current_user.is_authenticated() or + if (not current_user.is_authenticated or not provider.validate_has_scopes(client_id, current_user.db_user().username, scope)): if not provider.validate_redirect_uri(client_id, redirect_uri): current_app = provider.get_application_for_client_id(client_id)