[Django] #29718: Small backwards-incompatibility in Django 2.1

17 views
Skip to first unread message

Django

unread,
Aug 28, 2018, 8:03:08 AM8/28/18
to django-...@googlegroups.com
#29718: Small backwards-incompatibility in Django 2.1
------------------------------------------------+------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
I have a `cupido.Device` Model and a corresponding ModelAdmin with a
custom view that renders a template called
`admin/cupido/device/search_form.html`.

After upgrading to Django 2.1, the changelist view crashes with a very
confusing error:

{{{
NoReverseMatch at /admin/cupido/device/
Reverse for 'app_list' with keyword arguments '{'app_label': ''}' not
found. 1 pattern(s) tried: ['admin\\/(?P<app_label>auth|cupido)/$']
}}}

This is because Django now supports overriding
`admin/<app_label>/<model_name>/search_form.html` and picks up my
template, which breaks because it was written for a completely different
purpose. This pitfall — the risk of collision with preexisting templates —
could be mentioned in the 2.1 release notes.

Furthermore, the debug view doesn't identify the correct line. It says
there's an error at line 11 (see attachment) but I couldn't identify any
template in which a line 11 contains a `{% url ... %}` tag that could
result in this error. I have no idea what's happening there; I couldn't
put together a good bug report for that problem.

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

Django

unread,
Aug 28, 2018, 8:05:35 AM8/28/18
to django-...@googlegroups.com
#29718: Small backwards-incompatibility in Django 2.1
-------------------------------------+-------------------------------------

Reporter: Aymeric Augustin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aymeric Augustin):

* Attachment "Capture d’écran 2018-08-28 à 14.04.32.png" added.

Django

unread,
Aug 28, 2018, 8:18:26 AM8/28/18
to django-...@googlegroups.com
#29718: Document admin template collision backwards incompatibility in Django 2.1
--------------------------------------+------------------------------------

Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* component: contrib.admin => Documentation
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/10353 PR]

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

Django

unread,
Aug 28, 2018, 8:20:58 AM8/28/18
to django-...@googlegroups.com
#29718: Document admin template collision backwards incompatibility in Django 2.1
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham):

#28935 could be the issue about the incorrect debug page location.

--
Ticket URL: <https://code.djangoproject.com/ticket/29718#comment:2>

Django

unread,
Aug 28, 2018, 2:40:33 PM8/28/18
to django-...@googlegroups.com
#29718: Document admin template collision backwards incompatibility in Django 2.1
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by GitHub <noreply@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"166dec84069c15ecb2bc3a5590f872febdc4709c" 166dec84]:
{{{
#!CommitTicketReference repository=""
revision="166dec84069c15ecb2bc3a5590f872febdc4709c"
Fixed #29718 -- Doc'd admin template collision backwards incompatibility
in Django 2.1.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29718#comment:3>

Django

unread,
Aug 28, 2018, 2:41:06 PM8/28/18
to django-...@googlegroups.com
#29718: Document admin template collision backwards incompatibility in Django 2.1
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"c4559d0b39087e82a546c16e7412a7c097787bf0" c4559d0b]:
{{{
#!CommitTicketReference repository=""
revision="c4559d0b39087e82a546c16e7412a7c097787bf0"
[2.1.x] Fixed #29718 -- Doc'd admin template collision backwards
incompatibility in Django 2.1.

Backport of 166dec84069c15ecb2bc3a5590f872febdc4709c from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29718#comment:4>

Reply all
Reply to author
Forward
0 new messages