From dfae2679a6be1d3e61eaa9f83e85e0daf655187c Mon Sep 17 00:00:00 2001 From: Charles-Axel Dein Date: Wed, 5 Mar 2014 15:22:59 -0800 Subject: [PATCH] Clarify the after_request argument Make it a bit clearer that it's an instance of response_class that is expected, not the actual response_class class. --- flask/app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flask/app.py b/flask/app.py index 257c5e93..2bff6af0 100644 --- a/flask/app.py +++ b/flask/app.py @@ -1219,9 +1219,11 @@ class Flask(_PackageBoundObject): @setupmethod def after_request(self, f): - """Register a function to be run after each request. Your function - must take one parameter, a :attr:`response_class` object and return - a new response object or the same (see :meth:`process_response`). + """Register a function to be run after each request. + + Your function must take one parameter, an instance of + :attr:`response_class` and return a new response object or the + same (see :meth:`process_response`). As of Flask 0.7 this function might not be executed at the end of the request in case an unhandled exception occurred.