Code

Opened 5 months ago

Closed 5 months ago

#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.

Attachments (0)

Change History (7)

comment:1 Changed 5 months ago by pmartin

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

comment:2 Changed 5 months ago by claudep

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

FWIW, doesn't affect 1.6 branch.

comment:3 Changed 5 months ago by unaizalakain

  • Cc unai@… added

comment:4 Changed 5 months ago by pmartin

I added tests :-)

comment:5 Changed 5 months ago by unaizalakain

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

comment:6 Changed 5 months ago by pmartin

Thanks you Unai

comment:7 Changed 5 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.