madewithwagtail
madewithwagtail copied to clipboard
Accessing sitemap.xml raises a few errors
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.
request template context processor is in place. context['request']
shouldn't fail in this configuration.
Sentry issue: MADEWITHWAGTAIL-6
Maybe related with: MADEWITHWAGTAIL-Fh