From db72d24af4128b9f9a8c31470d8f09e9375bc203 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 27 May 2019 21:23:26 +0800 Subject: [PATCH] chg: dev: better boolean conversion --- bukuserver/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bukuserver/server.py b/bukuserver/server.py index b79991f..cea0eeb 100644 --- a/bukuserver/server.py +++ b/bukuserver/server.py @@ -221,7 +221,9 @@ def create_app(db_file=None): url_render_mode = views.DEFAULT_URL_RENDER_MODE app.config['BUKUSERVER_URL_RENDER_MODE'] = url_render_mode app.config['SECRET_KEY'] = os.getenv('BUKUSERVER_SECRET_KEY') or os.urandom(24) - app.config['BUKUSERVER_DISABLE_FAVICON'] = bool(os.getenv('BUKUSERVER_DISABLE_FAVICON', False)) + disable_favicon = os.getenv('BUKUSERVER_DISABLE_FAVICON', 'false') + app.config['BUKUSERVER_DISABLE_FAVICON'] = \ + False if disable_favicon.lower() in ['false', '0'] else bool(disable_favicon) app.config['BUKUSERVER_DB_FILE'] = os.getenv('BUKUSERVER_DB_FILE') or db_file bukudb = BukuDb(dbfile=app.config['BUKUSERVER_DB_FILE']) app.app_context().push()