Opened 23 months ago

Last modified 23 months ago

#34155 closed Uncategorized

ModelAdmin.render_change_form does not lowercase the app_label when setting template directories — at Version 2

Reported by: Rishi Diwan Owned by: nobody
Component: contrib.admin Version: 3.2
Severity: Normal Keywords:
Cc: Carlton Gibson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Rishi Diwan)

In case of differing environments, such as the linux FS and the OSX FS, folders case-matching is important.

Consider an application with:
app label = "App"
model name = "Inventory" with tablename="inventory"

If a particular model's change_form.html needs to be overwritten we would do the following
Overwrite template/django/admin/App/inventory/change_form.html
This works fine on Linux systems.
However on OSX systems the file shows up as template/django/admin/app/inventory/change_form.html.
This breaks the functionality since the template is no longer found in the App/inventory directory.

The app_label variable should be lowercased so the differing file systems do not cause this issue.

Change History (2)

comment:1 by Rishi Diwan, 23 months ago

Version: 4.13.2

comment:2 by Rishi Diwan, 23 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top