From 83672736d5ddf95c7ea48eef2d9d104f203f24ac Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 4 Jun 2021 21:34:05 -0700 Subject: [PATCH] Remove unnecessary intermediate variable ip. --- frontends/ycdl_flask/backend/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontends/ycdl_flask/backend/common.py b/frontends/ycdl_flask/backend/common.py index a109cae..c7b23fb 100644 --- a/frontends/ycdl_flask/backend/common.py +++ b/frontends/ycdl_flask/backend/common.py @@ -41,8 +41,7 @@ site.localhost_only = False @site.before_request def before_request(): - ip = request.remote_addr - request.is_localhost = ip == '127.0.0.1' + request.is_localhost = (request.remote_addr == '127.0.0.1') if site.localhost_only and not request.is_localhost: flask.abort(403)