﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26915	Template response middleware skipped for responses returned from view middleware	Alex Hill	nobody	"Hi,

I upgraded a project from 1.9 to 1.10rc1 to test the waters. There's a regression when returning a response object from a view middleware - Django 1.10 does not apply template response middleware to the response, or render it when required.

As well as your template response middleware being skipped, the unrendered response causes trouble when passed to a lot of response middleware which expects response.content to be set.

When you do this in Django 1.9, remaining view middleware is skipped, but template response middleware is applied and the response is rendered.

See the difference:

1.9: https://github.com/django/django/blob/stable/1.9.x/django/core/handlers/base.py#L138

1.10: https://github.com/django/django/blob/stable/1.10.x/django/core/handlers/base.py#L176

I couldn't find any reference to this in the release notes so I'm assuming it's not intentional. Restoring the `break` statement and the following `if response is None` block restores the old behaviour without breaking any tests."	Bug	closed	HTTP handling	1.10	Release blocker	fixed			Accepted	1	0	0	0	0	0
