#21460 closed Bug (fixed)

Bug in cache template loader

Reported by: pmartin Owned by: pmartin
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 22 months ago by pmartin

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

comment:2 Changed 22 months ago by claudep

  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

FWIW, doesn't affect 1.6 branch.

comment:3 Changed 22 months ago by unaizalakain

  • Cc unai@… added

comment:4 Changed 22 months ago by pmartin

I added tests :-)

comment:5 Changed 22 months ago by unaizalakain

  • Needs tests unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 22 months ago by pmartin

Thanks you Unai

comment:7 Changed 22 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

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