forked from orbit-oss/flask
converters have access to session
This commit is contained in:
parent
8648750997
commit
a7b02b3a07
4 changed files with 28 additions and 16 deletions
|
|
@ -395,9 +395,6 @@ class RequestContext:
|
|||
|
||||
_request_ctx_stack.push(self)
|
||||
|
||||
if self.url_adapter is not None:
|
||||
self.match_request()
|
||||
|
||||
# Open the session at the moment that the request context is available.
|
||||
# This allows a custom open_session method to use the request context.
|
||||
# Only open a new session if this is the first time the request was
|
||||
|
|
@ -409,6 +406,11 @@ class RequestContext:
|
|||
if self.session is None:
|
||||
self.session = session_interface.make_null_session(self.app)
|
||||
|
||||
# Match the request URL after loading the session, so that the
|
||||
# session is available in custom URL converters.
|
||||
if self.url_adapter is not None:
|
||||
self.match_request()
|
||||
|
||||
def pop(self, exc: t.Optional[BaseException] = _sentinel) -> None: # type: ignore
|
||||
"""Pops the request context and unbinds it by doing that. This will
|
||||
also trigger the execution of functions registered by the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue