summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamir Shah <solaris.smoke@gmail.com>2016-06-21 15:12:07 +0300
committerTim Graham <timograham@gmail.com>2016-06-21 08:12:28 -0400
commit69b46fcc39278dac3d44156fdd4040b4544f008f (patch)
tree1dfed36c8dda5de781f3257e270d3031a34a13c5
parent8c25d8fc10f017ed3f8e7bf97eb936495135632e (diff)
[1.10.x] Corrected firstof template tag's docstring.
Since Django 1.8, firstof escapes its output. Backport of fff5dbe59ca629c295480693f045f03537858eee from master
-rw-r--r--django/template/defaulttags.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 5a972e3a79..8923da655e 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -681,7 +681,7 @@ def do_filter(parser, token):
@register.tag
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.
@@ -692,11 +692,11 @@ def firstof(parser, token):
This is equivalent to::
{% if var1 %}
- {{ var1|safe }}
+ {{ var1 }}
{% elif var2 %}
- {{ var2|safe }}
+ {{ var2 }}
{% elif var3 %}
- {{ var3|safe }}
+ {{ var3 }}
{% endif %}
but obviously much cleaner!