1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

Fixed #16510 -- Actually added new truncatechars filter to the builtins and fixed a typo. Thanks, timdumol.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-07-25 09:19:47 +00:00
parent b8db443437
commit afd8a47df7

View File

@ -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 @@ register.filter(stringformat)
register.filter(striptags)
register.filter(time)
register.filter(title)
register.filter(truncatechars)
register.filter(truncatewords)
register.filter(truncatewords_html)
register.filter(unordered_list)