Opened 9 years ago
Last modified 9 years ago
#25697 closed Cleanup/optimization
Default error views shouldn't silence TemplateDoesNotExist errors if a custom template name was specified — at Version 1
Reported by: | Simon Charette | Owned by: | nobody |
---|---|---|---|
Component: | Generic views | Version: | dev |
Severity: | Normal | 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 (last modified by )
Default error views attempt to load a template from a default name and fallback to a string value if a TemplateDoesNotExist
error is raised in the process.
This behavior should be altered to actually raise the error if a custom template_name
is specified.
The affected views are:
django.views.defaults.page_not_found
django.views.defaults.server_error
django.views.defaults.bad_request
django.views.defaults.permission_denied
Note that the views were identified during a preliminary search and it's possible this pattern is used elsewhere in the Django code base.
We should consider deprecating this behavior instead of simply turning it on since it's slightly backward incompatible.
Thanks to Raphael Michel at #DUTH for helping identifying this issue.