[1.10.x] Corrected firstof template tag's docstring.

Since Django 1.8, firstof escapes its output.

Backport of fff5dbe59c from master
This commit is contained in:
Samir Shah 2016-06-21 15:12:07 +03:00 committed by Tim Graham
parent 8c25d8fc10
commit 69b46fcc39
1 changed files with 4 additions and 4 deletions

View File

@ -681,7 +681,7 @@ def do_filter(parser, token):
@register.tag @register.tag
def firstof(parser, token): def firstof(parser, token):
""" """
Outputs the first variable passed that is not False, without escaping. Outputs the first variable passed that is not False.
Outputs nothing if all the passed variables are False. Outputs nothing if all the passed variables are False.
@ -692,11 +692,11 @@ def firstof(parser, token):
This is equivalent to:: This is equivalent to::
{% if var1 %} {% if var1 %}
{{ var1|safe }} {{ var1 }}
{% elif var2 %} {% elif var2 %}
{{ var2|safe }} {{ var2 }}
{% elif var3 %} {% elif var3 %}
{{ var3|safe }} {{ var3 }}
{% endif %} {% endif %}
but obviously much cleaner! but obviously much cleaner!