Consider following code inside a django template:
{{{
{% include 'partials/_message.html' with
message_title="Unauthorised"
message_body="You need <strong>{{ perm_name }}</strong>
permission to access the content." %}
}}}
The issue is related to the output rendered in browser for *message_body*
when {% include %} is executed.
==== Expected output:
You need **read** permission to access the content.
==== Actual output:
You need **{{ perm_name }}** permission to access the content.
==== Notes
While the included template evaluates the passed in **<strong>** tag, it
does not evaluate the variable **{{ perm_name }}** and outputs it
verbatim.
--
Ticket URL: <https://code.djangoproject.com/ticket/28468>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Aymeric Augustin):
I think the current behavior is the expected behavior.
`"You need <strong>{{ perm_name }}</strong> permission to access the
content."` is a string literal.
--
Ticket URL: <https://code.djangoproject.com/ticket/28468#comment:1>
* status: new => closed
* resolution: => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/28468#comment:2>
Comment (by Liquid Scorpio):
Fair Enough. However, any suggested approach to get the desired output?
--
Ticket URL: <https://code.djangoproject.com/ticket/28468#comment:3>