Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #16510 -- Actually added new truncatechars filter to the builti…

…ns and fixed a typo. Thanks, timdumol.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit afd8a47df7b66a52a310c62a6385d45f7c17c1a0 1 parent b8db443
Jannis Leidel jezdez authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/template/defaultfilters.py
3  django/template/defaultfilters.py
View
@@ -254,7 +254,7 @@ def truncatechars(value, arg):
length = int(arg)
except ValueError: # Invalid literal for int().
return value # Fail silently.
- return Truncator(value).chars(value, length)
+ return Truncator(value).chars(length)
truncatechars.is_safe = True
truncatechars = stringfilter(truncatechars)
@@ -922,6 +922,7 @@ def pprint(value):
register.filter(striptags)
register.filter(time)
register.filter(title)
+register.filter(truncatechars)
register.filter(truncatewords)
register.filter(truncatewords_html)
register.filter(unordered_list)
Please sign in to comment.
Something went wrong with that request. Please try again.