Skip to content

Commit 7fd8960

Browse files
jrcastro2kpsherva
authored andcommitted
views: use .get() for THEME_FRONTPAGE to avoid hard dependency
* Switches from direct app.config["THEME_FRONTPAGE"] access to app.config.get("THEME_FRONTPAGE") to prevent KeyErrors in environments where the config is not set (e.g. alembic upgrades, or test contexts)
1 parent 25f18f8 commit 7fd8960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

invenio_theme/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def create_blueprint(app):
2222
static_folder="static",
2323
)
2424

25-
if app.config["THEME_FRONTPAGE"]:
25+
if app.config.get("THEME_FRONTPAGE"):
2626
blueprint.add_url_rule("/", "index", view_func=index)
2727

2828
return blueprint

0 commit comments

Comments
 (0)