#21184 closed Bug (fixed)

block.super does not render with reverse errors in super block

Reported by: schrinaw@… Owned by: nobody
Component: Template system Version: 1.5
Severity: Normal Keywords: block.super
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Simple example:
#parent.html
{% block parent %}
{% url "no reverse match" %} <- no reverse found, error
{% endblock parent %}

#child.html
{% extends "parent.html" %}
{% block parent %}
{{block.super}}
some other stuff
{% endblock parent %}

Rendering child.html, the block.super part does not appear. It fails "silently" rather than throwing the "no reverse match" error. Not sure if this is the intended behavior (why??), but it has caused me an hour of frustrating template debugging in two cases now. It was only when I moved the whole parent block into the child template (ie copy/paste) that the "no reverse match" error surfaced. I thought I had a problem with template inheritance the whole time.

Change History (3)

comment:1 Changed 18 months ago by mjtamlyn

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

I agree that this is not somewhere that we should be swallowing errors.

comment:2 Changed 18 months ago by bmispelon

Is this related to #20745?

comment:3 Changed 18 months ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

Could be. In any case this issue is already fixed in 1.6.x and master.

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