Browse Source

Add session to copy_current_request_context

pull/2936/head
Dave Chevell 6 years ago
parent
commit
d38649792a
No known key found for this signature in database
GPG Key ID: 279DF1B52C7C44DC
  1. 3
      flask/ctx.py

3
flask/ctx.py

@ -14,7 +14,7 @@ from functools import update_wrapper
from werkzeug.exceptions import HTTPException
from .globals import _request_ctx_stack, _app_ctx_stack
from .globals import session, _request_ctx_stack, _app_ctx_stack
from .signals import appcontext_pushed, appcontext_popped
from ._compat import BROKEN_PYPY_CTXMGR_EXIT, reraise
@ -147,6 +147,7 @@ def copy_current_request_context(f):
'when a request context is on the stack. For instance within '
'view functions.')
reqctx = top.copy()
reqctx.session = session.copy()
def wrapper(*args, **kwargs):
with reqctx:
return f(*args, **kwargs)

Loading…
Cancel
Save