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 Initial Version

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

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:

  1. django.views.defaults.page_not_found
  2. django.views.defaults.server_error
  3. django.views.defaults.bad_request
  4. 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.

Change History (0)

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