[Django] #22348: templates that extend admin/change_form throw difficult-to-track error

152 views
Skip to first unread message

Django

unread,
Mar 27, 2014, 2:44:20 PM3/27/14
to django-...@googlegroups.com
#22348: templates that extend admin/change_form throw difficult-to-track error
--------------------------+------------------------------------------------
Reporter: django@… | Owner: nobody
Type: | Status: new
Uncategorized | Version: 1.6
Component: Template | Keywords: template extends admin change_form
system | Has patch: 0
Severity: Normal | UI/UX: 0
Triage Stage: |
Unreviewed |
Easy pickings: 0 |
--------------------------+------------------------------------------------
The following template runs fine;

{% extends "admin/change_form.html" %}
{% block breadcrumbs %}
{% endblock %}

{% block content %}
Blah
{% endblock %}


However omitting the breadcrumbs block should be valid - you will just get
the breadcrumbs block from the parent;

{% extends "admin/change_form.html" %}

{% block content %}
Blah
{% endblock %}


however this throws a difficult to trace error;

NoReverseMatch at /admin/membership/reports/company/membershippaid/
Reverse for 'app_list' with arguments '()' and keyword arguments
'{u'app_label': ''}' not found. 1 pattern(s) tried:
[u'admin/(?P<app_label>\\w+)/$']

The admin/change_form.html template contains this;
{% url 'admin:app_list' app_label=opts.app_label %}
which i think is the code generating the error due to opts being empty.

It is possible that my system (upgraded from 1.2.3) is causing opts to be
blank - not sure how to test this, however putting [{{ opts }}] into the
template shows that opts is empty.

--
Ticket URL: <https://code.djangoproject.com/ticket/22348>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 28, 2014, 7:59:58 PM3/28/14
to django-...@googlegroups.com
#22348: templates that extend admin/change_form throw difficult-to-track error
-------------------------------------+-------------------------------------
Reporter: django@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Template system | Version: 1.6
Severity: Normal | Resolution: needsinfo
Keywords: template extends | Triage Stage:
admin change_form | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0


Comment:

Is /admin/membership/reports/company/membershippaid/ a custom admin view
that doesn't put `opts` in the context? This doesn't look like in bug in
Django to me. Please use our support channels and reopen the ticket if you
can provide more details.

https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels

--
Ticket URL: <https://code.djangoproject.com/ticket/22348#comment:1>

Reply all
Reply to author
Forward
0 new messages