[Django] #26229: Missing check for list_editable in admin

5 views
Skip to first unread message

Django

unread,
Feb 17, 2016, 8:58:22 AM2/17/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+--------------------
Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Arising from http://stackoverflow.com/questions/35456634/

If `list_display` and `list_editable` are both lists with a single item,
and `list_display_links` is not set, then the `list_editable` won't have
any effect, because the field will be displayed as a link rather than a
form field. We already have admin checks for usage of list_editable, but
this case does not appear to be covered.

{{{
class CustomAdmin(admin.ModelAdmin):
list_display = ('status', )
list_editable = ('status',)
}}}

#22792 is a related ticket.

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

Django

unread,
Feb 17, 2016, 9:02:13 AM2/17/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+--------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
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 alasdairnicol):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

When I get a chance, I will have a closer look at the code and try to work
out what the problem is .

At a first glance,
[https://github.com/django/django/blob/master/tests/modeladmin/tests.py#L1544
ListDisplayEditableTests] should have a test case similar to
test_list_display_same_as_list_editable, but with `list_display_links`
undefined. In that case, there should be a warning if the first item in
list_display is in list_editable.

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

Django

unread,
Feb 17, 2016, 10:48:57 AM2/17/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


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

Django

unread,
Feb 17, 2016, 6:19:52 PM2/17/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
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 alasdairnicol):

* has_patch: 0 => 1


Comment:

I've opened a pull request
https://github.com/django/django/pull/6156/files

The two old unit tests from #22792 still pass following my changes, and I
have added an addition test. However, I found it a tricky problem to get
my head around, so I'm not 100% certain I got it correct. I've added
comments to the pull request to explain my reasoning.

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

Django

unread,
Feb 26, 2016, 7:13:54 PM2/26/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


Comment:

Left a few comments for improvement.

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

Django

unread,
Feb 29, 2016, 6:07:02 AM2/29/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
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 alasdairnicol):

* needs_better_patch: 1 => 0


Comment:

Pull request updated as suggested.

--
Ticket URL: <https://code.djangoproject.com/ticket/26229#comment:5>

Django

unread,
Feb 29, 2016, 7:04:11 AM2/29/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
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 alasdairnicol):

New pull request is https://github.com/django/django/pull/6223

--
Ticket URL: <https://code.djangoproject.com/ticket/26229#comment:6>

Django

unread,
Mar 1, 2016, 8:21:24 AM3/1/16
to django-...@googlegroups.com
#26229: Missing check for list_editable in admin
-------------------------------+------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: master
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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"65bd053f11d22bca529f1da895599796fa0f3ee1" 65bd053f]:
{{{
#!CommitTicketReference repository=""
revision="65bd053f11d22bca529f1da895599796fa0f3ee1"
Fixed #26229 -- Improved check for model admin check admin.E124

Refs #22792
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26229#comment:7>

Reply all
Reply to author
Forward
0 new messages