Remove unnecessary intermediate variable ip.
This commit is contained in:
parent
742034d287
commit
83672736d5
1 changed files with 1 additions and 2 deletions
|
@ -41,8 +41,7 @@ site.localhost_only = False
|
||||||
|
|
||||||
@site.before_request
|
@site.before_request
|
||||||
def before_request():
|
def before_request():
|
||||||
ip = request.remote_addr
|
request.is_localhost = (request.remote_addr == '127.0.0.1')
|
||||||
request.is_localhost = ip == '127.0.0.1'
|
|
||||||
if site.localhost_only and not request.is_localhost:
|
if site.localhost_only and not request.is_localhost:
|
||||||
flask.abort(403)
|
flask.abort(403)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue