﻿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
33311	Disallow overriding parent blocks within conditionals.	Nat S Dunn	nobody	"When a parent block is overridden in an if condition, the overridden content is output regardless of the truthiness of the condition.  For example:

{{{
{% if False %}
  {% block parent %}Foo{% endblock parent %}
{% endif %}
}}}



Foo gets output, which feels wrong. Either this structure should be disallowed or the behavior should change.

If Django disallows overriding parent blocks within conditionals, then it would be great if the error message could include a hint describing the following workaround:

{{{
{% block parent %}
  {% if False %}
    {% block parent %}Foo{% endblock parent %}
  {% else %}
    {{ block.super }}
  {% endif %}
{% endblock parent %}
}}}"	Cleanup/optimization	closed	Template system	3.2	Normal	duplicate	block, conditional, if		Unreviewed	0	0	0	0	0	0
