willhardy / django-seo

Provides a set of tools for managing Search Engine Optimisation (SEO) for Django sites.
BSD 3-Clause "New" or "Revised" License
251 stars 117 forks source link

Small Error in templatetags.seo #17

Closed ghost closed 13 years ago

ghost commented 13 years ago

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 13 years ago

Well found!

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

willhardy commented 13 years ago

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

willhardy commented 13 years ago

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