Ticket #486: template-args-fix.patch
File template-args-fix.patch, 1021 bytes (added by , 19 years ago) |
---|
-
template.py
295 295 if registered_filters[filter_name][1] == True and arg is None: 296 296 raise TemplateSyntaxError, "Filter '%s' requires an argument" % filter_name 297 297 if registered_filters[filter_name][1] == False and arg is not None: 298 raise TemplateSyntaxError, "Filter '%s' should not have an argument " % filter_name298 raise TemplateSyntaxError, "Filter '%s' should not have an argument (argument is '%s')" % (filter_name, arg) 299 299 self.filters.append((filter_name, arg)) 300 300 if self.current is None: 301 301 break 302 302 303 303 def read_filter(self): 304 304 self.current_filter_name = self.read_alphanumeric_token() 305 self.current_filter_arg = None 305 306 # Have we reached the end? 306 307 if self.current is None: 307 308 return (self.current_filter_name, None)