safer check for requestviewer conf key
This commit is contained in:
@@ -39,9 +39,8 @@ def make_app(root, static_root=None, debug=False, errorcfg={}, wrap_app=None, lo
|
||||
app = Cascade([StaticURLParser(static_root), app])
|
||||
if isinstance(logging, dict) or logging == True:
|
||||
app = TransLogger(app, **(isinstance(logging, dict) and logging or {}))
|
||||
if conf.requestviewer:
|
||||
if hasattr(conf, 'requestviewer'):
|
||||
existing_hooks = kw.get('hooks', [])
|
||||
if RequestViewerHook not in existing_hooks:
|
||||
existing_hooks.append(RequestViewerHook(conf.requestviewer.as_dict()))
|
||||
kw['hooks'] = existing_hooks
|
||||
existing_hooks.append(RequestViewerHook(conf.requestviewer.as_dict()))
|
||||
kw['hooks'] = existing_hooks
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user