MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / admin_processor

Function admin_processor

openlibrary/admin/utils.py:9–20  ·  view source on GitHub ↗

web.py application processor for enabling infogami and verifying admin permissions.

(handler)

Source from the content-addressed store, hash-verified

7
8
9def admin_processor(handler):
10 """web.py application processor for enabling infogami and verifying admin permissions."""
11 delegate.initialize_context()
12 delegate.context.features = []
13 features.loadhook()
14
15 # required to give a special look and feel in site template
16 delegate.context.setdefault("cssfile", "admin")
17 delegate.context.setdefault("usergroup", "admin")
18
19 page = handler()
20 return render_template("site", page)
21
22
23def notfound():

Callers

nothing calls this directly

Calls 1

render_templateFunction · 0.50

Tested by

no test coverage detected