springload / madewithwagtail

A showcase of sites and apps made with Wagtail CMS, the easy to use, open source Django content management system
http://madewithwagtail.org
MIT License
84 stars 21 forks source link

Accessing sitemap.xml raises a few errors #110

Open loicteixeira opened 6 years ago

loicteixeira commented 6 years ago

Key Error

See MADEWITHWAGTAIL-6 and MADEWITHWAGTAIL-7 on Sentry.

In this context, request isn't available here: https://github.com/springload/madewithwagtail/blob/a04a2579f05a89121642cfaf6ef5062a69e78809/core/templatetags/core_tags.py#L31 This should be replaced with `context.get('request')

Note that the template uses the request here https://github.com/springload/madewithwagtail/blob/a04a2579f05a89121642cfaf6ef5062a69e78809/core/templates/core/includes/menu.html#L15 So we probably need to change the condition to {% if not request or not request.path == '/search/' %}

Although to be fair I'm a bit puzzled that this is run when sitemap.xml is requested. Maybe it reached this point as a fallback of the following issue.

TemplateDoesNotExists

See MADEWITHWAGTAIL-5 on Sentry.

The sitemap.xml template is not found.

mojeto commented 6 years ago

request template context processor is in place. context['request'] shouldn't fail in this configuration.

mojeto commented 5 years ago

Sentry issue: MADEWITHWAGTAIL-6

mojeto commented 5 years ago

Maybe related with: MADEWITHWAGTAIL-Fh