#24847 closed Bug (fixed)
Items set on a RequestContext after creation get lost
Reported by: | Phil Davis | Owned by: | Paweł Marczewski |
---|---|---|---|
Component: | Template system | Version: | 1.8 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
You cannot use c['foo'] = newvalue
on a RequestContext after creation as it gets stomped on by the different context processors logic in 1.8
>>> from django.template import Template, RequestContext >>> from django.http import HttpRequest >>> r = HttpRequest() >>> c = RequestContext(r, {'a': 'AAA'}) >>> t = Template('a is <{{a}}> and b is <{{b}}>') >>> c['b'] = 'BBB' >>> t.render(c) u'a is <AAA> and b is <>'
In the above note that 'b' is not rendered in the template.
Attachments (1)
Change History (6)
comment:1 by , 10 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
Hi,
I can confirm that this issue exists and it wasn't present in 1.7 so I'm bumping the severity.
With the help of the attached test case, I bisected the issue to commit 37505b6397058bcc3460f23d48a7de9641cd6ef0.
Thanks.