Skip to content
Browse files

Fixed #3912 - Added simple type checking to template.Context.update()…

… to help debugging broken context processors. Thanks Jeremy Dunck

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8dff194 commit ff486b9fba1eaffdf204c4b0ee8babf0d3627725 @spookylukey spookylukey committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/template/
2 django/template/
@@ -62,6 +62,8 @@ def get(self, key, otherwise=None):
def update(self, other_dict):
"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
return other_dict

0 comments on commit ff486b9

Please sign in to comment.
Something went wrong with that request. Please try again.