Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit e2e98aff6a58a497f66a473b3fad9ed99e4cb755 1 parent 2891195
Adrian Holovaty authored November 30, 2005

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/core/template/__init__.py
5  django/core/template/__init__.py
@@ -788,7 +788,7 @@ def __init__(self):
788 788
         self.filters = {}
789 789
         self.tags = {}
790 790
 
791  
-    def tag(self, name = None, compile_function = None):
  791
+    def tag(self, name=None, compile_function=None):
792 792
         if name == None and compile_function == None:
793 793
             # @register.tag()
794 794
             return self.tag_function
@@ -812,7 +812,7 @@ def tag_function(self,func):
812 812
         self.tags[func.__name__] = func
813 813
         return func
814 814
 
815  
-    def filter(self, name = None, filter_func = None):
  815
+    def filter(self, name=None, filter_func=None):
816 816
         if name == None and filter_func == None:
817 817
             # @register.filter()
818 818
             return self.filter_function
@@ -828,6 +828,7 @@ def dec(func):
828 828
         elif name != None and filter_func != None:
829 829
             # register.filter('somename', somefunc)
830 830
             self.filters[name] = filter_func
  831
+            return filter_func
831 832
         else:
832 833
             raise InvalidTemplateLibrary, "Unsupported arguments to Library.filter: (%r, %r, %r)", (name, compile_function, has_arg)
833 834
 

0 notes on commit e2e98af

Please sign in to comment.
Something went wrong with that request. Please try again.