mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #11687: the add filter is now less failsome when faced with things that can't be coerced to integers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -651,7 +651,13 @@ unordered_list.needs_autoescape = True
|
||||
|
||||
def add(value, arg):
|
||||
"""Adds the arg to the value."""
|
||||
return int(value) + int(arg)
|
||||
try:
|
||||
return int(value) + int(arg)
|
||||
except (ValueError, TypeError):
|
||||
try:
|
||||
return value + arg
|
||||
except:
|
||||
return value
|
||||
add.is_safe = False
|
||||
|
||||
def get_digit(value, arg):
|
||||
|
||||
Reference in New Issue
Block a user