summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorGeorge Y. Kussumoto <georgeyk.dev@gmail.com>2024-06-04 15:07:01 -0300
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-06-13 14:22:40 +0200
commit2a32b233822683c51e59722b7c9aa0789fc4ab1b (patch)
treefe05cbfb38f376409b059a74bb3906ee7940aa0c /django/template
parent8733e9af998f0009d62e4f0f3d5ee566e93a4893 (diff)
Fixed #35417 -- Updated BaseContext.new() with values to create a context that can be flattened.
Diffstat (limited to 'django/template')
-rw-r--r--django/template/context.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/context.py b/django/template/context.py
index 080a2dd9c0..0c28b479cd 100644
--- a/django/template/context.py
+++ b/django/template/context.py
@@ -31,7 +31,9 @@ class BaseContext:
def _reset_dicts(self, value=None):
builtins = {"True": True, "False": False, "None": None}
self.dicts = [builtins]
- if value is not None:
+ if isinstance(value, BaseContext):
+ self.dicts += value.dicts[1:]
+ elif value is not None:
self.dicts.append(value)
def __copy__(self):