-
Notifications
You must be signed in to change notification settings - Fork 12
KeyError request['context'] in AbsoluteURLNode #6
Copy link
Copy link
Open
Description
I have an issue with the render method of AbsoluteURLNode.
It doesn't find the context['request'] when being rendered...
Any help would be welcomed!
File designs/templatetags/email.py line 14 in render:
request = context['request']
File django/template/context.py line 56 in getitem:
raise KeyError(key)
KeyError: 'request'
This comes from the code:
class AbsoluteUrlNode(URLNode):
def render(self, context):
asvar, self.asvar = self.asvar, None # Needed to get a return value from super
path = super(AbsoluteUrlNode, self).render(context)
self.asvar = asvar
request = context['request']
absolute_url = request.build_absolute_uri(path)
if asvar:
context[asvar] = absolute_url
return ''
else:
return absolute_url```Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels