willhardy/django-seo

Small Error in templatetags.seo

Closed this issue · 3 comments

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

Well found!

This also means that the exception is never properly raised in the tests...

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 :-)

Closed by 702d8f0. Raising a TemplateSyntaxError on our own terms.