Skip to content
Discussion options

You must be logged in to vote

config inside a Jinja template is Flask's own template global (app.config), unless the view passes its own config= into the render context. The admin views do: cps/admin.py calls render_title_template("admin.html", ..., config=config, ...) (and the same for config_edit.html and a few others), which shadows the global with Calibre-Web's config object. That's why {{ config.config_shelfmark_url }} resolves on /admin/view and /admin/config. On every other page the name config is Flask's config dict, the lookup finds no such key and renders an empty string.

render_title_template() in cps/render_template.py passes instance, sidebar, simple, accept, magic_shelf_routes and duplicate_notification to

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zuhairhalawa
Comment options

@lossofworth
Comment options

@zuhairhalawa
Comment options

Answer selected by lossofworth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants