summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-09-11 15:18:04 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-09-11 15:18:04 +0000
commit095305cb44e669c9e732eb7c90264795408bb4b8 (patch)
tree95be4d7978750fc4d19a1e57c6f454e284356873 /django
parente01ef9ddd88a982150cb5eb203bb0b9c2e47c243 (diff)
Fixed #486 -- Fixed bug in template filter parsing in edge cases, and added unit tests. Thanks, Simon
git-svn-id: http://code.djangoproject.com/svn/django/trunk@634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/template.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/template.py b/django/core/template.py
index b7faebd70c..e727e3e5fa 100644
--- a/django/core/template.py
+++ b/django/core/template.py
@@ -295,13 +295,14 @@ class FilterParser:
if registered_filters[filter_name][1] == True and arg is None:
raise TemplateSyntaxError, "Filter '%s' requires an argument" % filter_name
if registered_filters[filter_name][1] == False and arg is not None:
- raise TemplateSyntaxError, "Filter '%s' should not have an argument" % filter_name
+ raise TemplateSyntaxError, "Filter '%s' should not have an argument (argument is %r)" % (filter_name, arg)
self.filters.append((filter_name, arg))
if self.current is None:
break
def read_filter(self):
self.current_filter_name = self.read_alphanumeric_token()
+ self.current_filter_arg = None
# Have we reached the end?
if self.current is None:
return (self.current_filter_name, None)