mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Refs #28909 -- Simplifed code using unpacking generalizations.
This commit is contained in:
@@ -30,7 +30,6 @@ class EngineHandler:
|
||||
templates = OrderedDict()
|
||||
backend_names = []
|
||||
for tpl in self._templates:
|
||||
tpl = tpl.copy()
|
||||
try:
|
||||
# This will raise an exception if 'BACKEND' doesn't exist or
|
||||
# isn't a string containing at least one dot.
|
||||
@@ -41,10 +40,13 @@ class EngineHandler:
|
||||
"Invalid BACKEND for a template engine: {}. Check "
|
||||
"your TEMPLATES setting.".format(invalid_backend))
|
||||
|
||||
tpl.setdefault('NAME', default_name)
|
||||
tpl.setdefault('DIRS', [])
|
||||
tpl.setdefault('APP_DIRS', False)
|
||||
tpl.setdefault('OPTIONS', {})
|
||||
tpl = {
|
||||
'NAME': default_name,
|
||||
'DIRS': [],
|
||||
'APP_DIRS': False,
|
||||
'OPTIONS': {},
|
||||
**tpl,
|
||||
}
|
||||
|
||||
templates[tpl['NAME']] = tpl
|
||||
backend_names.append(tpl['NAME'])
|
||||
|
||||
Reference in New Issue
Block a user