#24685 closed Bug (fixed)
EngineHandler doesn't raise exception when duplicate aliases are registered
| Reported by: | Preston Timmons | Owned by: | Aymeric Augustin |
|---|---|---|---|
| Component: | Template system | Version: | 1.8 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The django.template.utils.EngineHandler has a check to raise ImproperlyConfigured if multiple engines are specified with the same alias:
https://github.com/django/django/blob/master/django/template/utils.py#L72
This won't ever raise an error, though, because configuration is stored in an OrderedDict. Duplicate aliases simply overwrite previous ones.
Curtis ran into this problem when using settings like this without the NAME option:
TEMPLATES = [
{
'BACKEND': 'knights.django.KnightsTemplater',
...
},
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
...
},
]
Change History (6)
comment:1 by , 11 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 10 years ago
| Has patch: | set |
|---|
comment:4 by , 10 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
How embarrassing.