Source code for oioioi.base.utils.middleware
# Django converts exceptions from middlewares to HttpResponses with above
# status codes. Overridable method of middleware factory process_exception()
# processes only exceptions generated by the view itself, but sometimes we want
# to proceed with a certain action when some other middleware throws.
[docs]def was_response_generated_by_exception(response):
return response.status_code in EXCEPTION_GENERATED_STATUS_CODES