1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #24603 -- Allowed Context.update() to be used as a context manager.

This commit is contained in:
Tommy Beadle
2015-04-13 10:57:44 -04:00
committed by Tim Graham
parent c612786cf1
commit 6bfd864ff2
4 changed files with 32 additions and 2 deletions

View File

@@ -171,8 +171,7 @@ class Context(BaseContext):
"Pushes other_dict to the stack of dictionaries in the Context"
if not hasattr(other_dict, '__getitem__'):
raise TypeError('other_dict must be a mapping (dictionary-like) object.')
self.dicts.append(other_dict)
return other_dict
return ContextDict(self, other_dict)
class RenderContext(BaseContext):