chg: dev: better boolean conversion

This commit is contained in:
rachmadaniHaryono 2019-05-27 21:23:26 +08:00
parent 74bbbdde2f
commit db72d24af4

View File

@ -221,7 +221,9 @@ def create_app(db_file=None):
url_render_mode = views.DEFAULT_URL_RENDER_MODE url_render_mode = views.DEFAULT_URL_RENDER_MODE
app.config['BUKUSERVER_URL_RENDER_MODE'] = 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['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 app.config['BUKUSERVER_DB_FILE'] = os.getenv('BUKUSERVER_DB_FILE') or db_file
bukudb = BukuDb(dbfile=app.config['BUKUSERVER_DB_FILE']) bukudb = BukuDb(dbfile=app.config['BUKUSERVER_DB_FILE'])
app.app_context().push() app.app_context().push()