summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-11-30 00:08:56 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-11-30 00:08:56 +0000
commite2e98aff6a58a497f66a473b3fad9ed99e4cb755 (patch)
tree1f34529e549271f2ff107dce63680f8f51f5e062
parent289119563e5622ee42368177f7e97a1861a66aac (diff)
Fixed #962 -- Gave filter-registration decorator a return statement. Thanks, Kieran
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/template/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/core/template/__init__.py b/django/core/template/__init__.py
index ed502c5a17..e498fda00c 100644
--- a/django/core/template/__init__.py
+++ b/django/core/template/__init__.py
@@ -788,7 +788,7 @@ class Library(object):
self.filters = {}
self.tags = {}
- def tag(self, name = None, compile_function = None):
+ def tag(self, name=None, compile_function=None):
if name == None and compile_function == None:
# @register.tag()
return self.tag_function
@@ -812,7 +812,7 @@ class Library(object):
self.tags[func.__name__] = func
return func
- def filter(self, name = None, filter_func = None):
+ def filter(self, name=None, filter_func=None):
if name == None and filter_func == None:
# @register.filter()
return self.filter_function
@@ -828,6 +828,7 @@ class Library(object):
elif name != None and filter_func != None:
# register.filter('somename', somefunc)
self.filters[name] = filter_func
+ return filter_func
else:
raise InvalidTemplateLibrary, "Unsupported arguments to Library.filter: (%r, %r, %r)", (name, compile_function, has_arg)