Opened 3 years ago

Closed 3 years ago

#21460 closed Bug (fixed)

Bug in cache template loader

Reported by: Pablo Martín Owned by: Pablo Martín
Component: Template system Version: master
Severity: Release blocker Keywords:
Cc: unai@… 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

In this commit [5154c9f92caa38bd5893320ed72fbc7305233822#diff-aed42ee20a44c4ff4f09eb2b8a6ae870R31] was introduced the next error.

We have the next template loaders in our settings, e.g.:

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

TEMPLATE_LOADERS = (('django.template.loaders.cached.Loader', (TEMPLATE_LOADERS)),)

And e.g. we have overwritten in our proyect templates, the template admin/change_form.html, the find_template method of the cache template loader will return the template admin/change_form.html of django.contrib.admin instead of the template of our project.

Change History (7)

comment:1 Changed 3 years ago by Pablo Martín

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 3 years ago by Claude Paroz

Needs tests: set
Triage Stage: UnreviewedAccepted

FWIW, doesn't affect 1.6 branch.

comment:3 Changed 3 years ago by Unai Zalakain

Cc: unai@… added

comment:4 Changed 3 years ago by Pablo Martín

I added tests :-)

comment:5 Changed 3 years ago by Unai Zalakain

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 Changed 3 years ago by Pablo Martín

Thanks you Unai

comment:7 Changed 3 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 3ac823fc5b88db7808f4d1cbca122713c6c9e03a:

Fixed #21460 -- Reenabled proper template precedence in find_template

Refs #20806. Thanks Unai Zalakain for the review.

Note: See TracTickets for help on using tickets.
Back to Top