Code

Opened 8 months ago

Closed 8 months ago

#21393 closed Cleanup/optimization (invalid)

Specific exception for when an extended template doesn't exist

Reported by: unaizalakain Owned by:
Component: Template system Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

#8116 defines a specific exception for when included templates doesn't exist (IncludedTemplateDoesNotExist). The reason for that is that otherwise, the normal TemplateDoesNotExist is swallowed by django.template.loader.select_template.

While there's no any problem with TemplateDoesNotExist being raised when an extended template doesn't exist, it could maybe be beneficial to raise a more specific exception, I don't know.

Attachments (0)

Change History (1)

comment:1 Changed 8 months ago by chrismedrela

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

django.template.loader.select_template doesn't swallow TemplateDoesNotExist since ​https://github.com/django/django/commit/e2f06226ea4a38377cdb69f2f5768e4e00c2d88e so there is no need for IncludedTemplateDoesNotExist, so we don't have any reason to change the class hierarchy of template exceptions. If I'm missing something, feel free to reopen this ticket.

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.