﻿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
14169	Improve TemplateSyntaxError for invalid block tags	Filip Dupanović	nobody	"some_template.html:

    {% block someblock %}{% endblock %}

some_other_template.html: 

    {% extends 'some_template.html' %}
    {% block someblock %}
       {% blocktrans %}
          Hello world!
       {% endblocktrans%}
    {% endlbock %}

Django raises a TemplateSyntaxError with an exception value ""Invalid block tag: 'blocktrans', expected 'endblock' or 'endblock someblock'. Because I didn't take my morning coffee, this put me way off thinking since when was {% blocktrans %} an invalid node for {% block %}? 20 minutes later, after reverting from trunk to the v1.2 tag, I've just figured I've never loaded the {% blocktrans %} tag in the first place. Could this particular instance of TemplateSyntaxError be expanded to perform an additional check to see if `sometag` is actually loaded.

This would seem a more appropriate exception value:

Invalid block tag: 'blocktrans'

"		closed	Template system	dev		wontfix	TemplateSyntaxError, exception value		Unreviewed	0	0	0	0	0	0
