Method: flask.templating._default_template_ctx_processor
Calls: 48, Exceptions: 0, Paths: 2Back
Path 1: 44 calls (0.92)
dict (44)
1def _default_template_ctx_processor() -> dict[str, t.Any]:
2 """Default template context processor. Injects `request`,
3 `session` and `g`.
4 """
5 appctx = _cv_app.get(None)
6 reqctx = _cv_request.get(None)
7 rv: dict[str, t.Any] = {}
8 if appctx is not None:
9 rv["g"] = appctx.g
10 if reqctx is not None:
11 rv["request"] = reqctx.request
12 rv["session"] = reqctx.session
13 return rv
Path 2: 4 calls (0.08)
dict (4)
1def _default_template_ctx_processor() -> dict[str, t.Any]:
2 """Default template context processor. Injects `request`,
3 `session` and `g`.
4 """
5 appctx = _cv_app.get(None)
6 reqctx = _cv_request.get(None)
7 rv: dict[str, t.Any] = {}
8 if appctx is not None:
9 rv["g"] = appctx.g
10 if reqctx is not None:
11 rv["request"] = reqctx.request
12 rv["session"] = reqctx.session
13 return rv