From 812772a31db2980272edc6dfc1bdd2003ed3f73c Mon Sep 17 00:00:00 2001 From: Daniel Chimeno Date: Thu, 25 Jan 2018 12:41:35 +0100 Subject: [PATCH] more pythonic example --- docs/api-guide/exceptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md index ba3d5af9b..3b10c2d3b 100644 --- a/docs/api-guide/exceptions.md +++ b/docs/api-guide/exceptions.md @@ -67,7 +67,7 @@ In order to alter the style of the response, you could write the following custo response = exception_handler(exc, context) # Now add the HTTP status code to the response. - if response is not None: + if response: response.data['status_code'] = response.status_code return response