Skip to content
Myr

Clarified the docstring in method Flask.preprocess_request.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The doc now clearly states that the method invokes two set of hook functions, and how these are filtered before execution.

authored by Aviv Cohn · committed by Aviv Cohn · parent 23cf923 · Browse files · 1 file+10 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−8 removed

  • other:+10 added−8 removed

1 file+10 added−8 removed

modified:flask/app.py+10 added-8 removed
1789 unmodified lines
1790 reraise(exc_type, exc_value, tb)1791 raise error17921793 def preprocess_request(self):1794 """Called before the actual request dispatching and will1795 call each :meth:`before_request` decorated function, passing no1796 arguments.1797 If any of these functions returns a value, it's handled as1798 if it was the return value from the view and further1799 request handling is stopped.1794 """Called before the request dispatching.17951801 This also triggers the :meth:`url_value_processor` functions before1802 the actual :meth:`before_request` functions are called.1796 Triggers two set of hook functions that should be invoked prior to request dispatching:1797 :attr:`url_value_preprocessors` and :attr:`before_request_funcs`1798 (the latter are functions decorated with :meth:`before_request` decorator).1799 In both cases, the method triggers only the functions that are either global1800 or registered to the current blueprint.18011802 If any function in :attr:`before_request_funcs` returns a value, it's handled as if it was1803 the return value from the view function, and further request handling is stopped.1804 """18051806 bp = _request_ctx_stack.top.request.blueprint18071808 funcs = self.url_value_preprocessors.get(None, ())1809 if bp is not None and bp in self.url_value_preprocessors:
178 unmodified lines