Fixed #3912 - Added simple type checking to template.Context.update() to help debugging broken context processors. Thanks Jeremy Dunck
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8dff194e9b
commit
ff486b9fba
|
@ -62,6 +62,8 @@ class Context(object):
|
||||||
|
|
||||||
def update(self, other_dict):
|
def update(self, other_dict):
|
||||||
"Like dict.update(). Pushes an entire dictionary's keys and values onto the context."
|
"Like dict.update(). Pushes an entire dictionary's keys and values onto the context."
|
||||||
|
if not hasattr(other_dict, '__getitem__'):
|
||||||
|
raise TypeError('other_dict must be a mapping (dictionary-like) object.')
|
||||||
self.dicts = [other_dict] + self.dicts
|
self.dicts = [other_dict] + self.dicts
|
||||||
return other_dict
|
return other_dict
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue