From 3203f3af844dbea33ac443cc2786260cceb0a47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Thu, 3 May 2018 14:11:02 +0200 Subject: [PATCH] Refactor get_url to a lambda --- solvable/src/webservice/server.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/solvable/src/webservice/server.py b/solvable/src/webservice/server.py index f76a5d8..0e8fe90 100644 --- a/solvable/src/webservice/server.py +++ b/solvable/src/webservice/server.py @@ -10,11 +10,7 @@ BASEURL = getenv('BASEURL', '') init_db() app = Flask(__name__) app.secret_key = urandom(32) - - -def get_url(endpoint): - return f'{BASEURL}{url_for(endpoint)}' -app.jinja_env.globals.update(get_url=get_url) +app.jinja_env.globals.update(get_url=lambda endpoint: f'{BASEURL}{url_for(endpoint)}') # pylint: disable=no-member @app.route('/', methods=['GET', 'POST'])