mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #24685 -- Fixed check for template name unicity.
Thanks Preston Timmons for the report.
This commit is contained in:
@@ -50,6 +50,7 @@ class EngineHandler(object):
|
||||
]
|
||||
|
||||
templates = OrderedDict()
|
||||
backend_names = []
|
||||
for tpl in self._templates:
|
||||
tpl = tpl.copy()
|
||||
try:
|
||||
@@ -68,8 +69,9 @@ class EngineHandler(object):
|
||||
tpl.setdefault('OPTIONS', {})
|
||||
|
||||
templates[tpl['NAME']] = tpl
|
||||
backend_names.append(tpl['NAME'])
|
||||
|
||||
counts = Counter(list(templates))
|
||||
counts = Counter(backend_names)
|
||||
duplicates = [alias for alias, count in counts.most_common() if count > 1]
|
||||
if duplicates:
|
||||
raise ImproperlyConfigured(
|
||||
|
||||
Reference in New Issue
Block a user