{{{
{% 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 %}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33311>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Comment:
This is by design, see also discussions in related tickets #13399, #20219,
#24232, and #4529.
Duplicate of #13413,
--
Ticket URL: <https://code.djangoproject.com/ticket/33311#comment:1>