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 19915 "templatetag ""blocktrans"" ignores the TEMPLATE_STRING_IF_INVALID setting" Natalia Bidart matiasb "If I define the setting TEMPLATE_STRING_IF_INVALID to something other than the empty string, for example: TEMPLATE_STRING_IF_INVALID = 'INVALID' when I have a template that uses the templatetag blocktrans, all those variables not defined in any context (neither local nor global context) are not shown as INVALID but they are rendered as the empty string instead. You can reproduce this by: * define the setting to be: {{{ TEMPLATE_STRING_IF_INVALID = 'INVALID' }}} * create a dummy template {{{foo.txt}}}: {{{ {% load i18n %} {% blocktrans %}Hello {{ thing }}! Django {{ action }} big time! {% endblocktrans %} }}} * render the template with an incomplete context: {{{ >>> from django.template.loader import render_to_string >>> print render_to_string('foo.txt', {'thing': 'world'}) Hello world! Django big time! }}} * then, remove the blocktrans tags, and re-render, you will get instead: {{{ >>> print render_to_string('foo.txt', {'thing': 'world'}) Hello world! Django INVALID big time! }}} I would expect the same behaviour with or without the use of blocktrans. " Bug closed Template system 1.4 Normal fixed blocktrans,template_string_if_invalid Accepted 1 0 0 0 0 0