Small Error in templatetags.seo
Closed this issue · 3 comments
Deleted user commented
On line 59 you should insert 'template.' before TemplateSyntaxError(e.msg) and you should removed the e.msg part from the argument
if not metadata:
# Fetch the metadata
try:
metadata = get_metadata(path, self.metadata_name, context, **kwargs)
except Exception, e:
raise TemplateSyntaxError(e.msg)
should be
if not metadata:
# Fetch the metadata
try:
metadata = get_metadata(path, self.metadata_name, context, **kwargs)
except Exception, e:
raise template.TemplateSyntaxError(e)
based on the way you have done the imports at the top of this file :)
G
willhardy commented
Well found!
This also means that the exception is never properly raised in the tests...
willhardy commented
Actually it was: The NameError
raised because of the bug you found was converted into a TemplateSyntaxError
, which is what we wanted to raise anyway, and what the test was looking for :-)