Browse Source

Use the _request_ctx_stack instead of the proxy for consistency with the others.

pull/311/head
Armin Ronacher 13 years ago
parent
commit
23bf2633f6
  1. 4
      flask/app.py

4
flask/app.py

@ -1397,7 +1397,7 @@ class Flask(_PackageBoundObject):
This also triggers the :meth:`url_value_processor` functions before
the actualy :meth:`before_request` functions are called.
"""
bp = request.blueprint
bp = _request_ctx_stack.top.request.blueprint
funcs = self.url_value_preprocessors.get(None, ())
if bp is not None and bp in self.url_value_preprocessors:
@ -1447,7 +1447,7 @@ class Flask(_PackageBoundObject):
tighter control over certain resources under testing environments.
"""
funcs = reversed(self.teardown_request_funcs.get(None, ()))
bp = request.blueprint
bp = _request_ctx_stack.top.request.blueprint
if bp is not None and bp in self.teardown_request_funcs:
funcs = chain(funcs, reversed(self.teardown_request_funcs[bp]))
exc = sys.exc_info()[1]

Loading…
Cancel
Save