[Django] #30980: admin.E130 (duplicate __name__ attributes of actions) should specify which were duplicated

33 views
Skip to first unread message

Django

unread,
Nov 12, 2019, 7:19:49 AM11/12/19
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated
------------------------------------------------+------------------------
Reporter: Keryn Knight | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
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 |
------------------------------------------------+------------------------
The fact that the `__name__` is used is somewhat an implementation detail,
and there's no guarantee the user has enough of an understanding of python
to know what that attribute is, let alone how to fix it.

This just came up on IRC because a user had defined `actions =
[delete_selected]` where `delete_selected` was a reference to their own
callable, but shares the name of the base one (and by specifying the
`actions = ` they were assuming that they were wholesale replacing the
actions list, where that may not be true for site-wide actions) so errored
... but they only had define a list of `len(...) == 1` so how can there be
a duplicate (is their thought process)?

The error message should specify those names that occur 2> (rather than
just check `len(...)` vs `len(set(...))`), and ought ideally to explain
where the duplicate comes from (ie: AdminSite-wide).

Related ticket about E130: #30311 (+ those it references) but is about the
replacement strategy rather than the error message itself.

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

Django

unread,
Nov 13, 2019, 3:33:59 AM11/13/19
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
--------------------------------------+------------------------------------

Reporter: Keryn Knight | Owner: nobody
Type: Cleanup/optimization | 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: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by felixxm):

* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Agreed, we can add names of duplicated actions to this message.

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

Django

unread,
Nov 14, 2019, 2:38:44 PM11/14/19
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: KESHAV
Type: | KUMAR
Cleanup/optimization | Status: assigned
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by KESHAV KUMAR):

* status: new => assigned
* owner: nobody => KESHAV KUMAR


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

Django

unread,
Nov 29, 2019, 1:17:39 PM11/29/19
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: KESHAV
Type: | KUMAR
Cleanup/optimization | Status: assigned
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by KESHAV KUMAR):

Hey! I am new to django contribution and I want to solve this issue. I
want to know that error message of duplicates should write after the error
of unique name in the same function ?

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

Django

unread,
Dec 27, 2019, 1:47:29 AM12/27/19
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: KESHAV
Type: | KUMAR
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Parth Patil):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_docs: 0 => 1


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

Django

unread,
Jan 7, 2020, 5:13:31 AM1/7/20
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: KESHAV
Type: | KUMAR
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

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

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

Django

unread,
Jan 10, 2020, 8:04:37 AM1/10/20
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: AdamDonna
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* owner: KESHAV KUMAR => AdamDonna
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
* needs_docs: 1 => 0


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

Django

unread,
Jan 10, 2020, 8:44:47 AM1/10/20
to django-...@googlegroups.com
#30980: admin.E130 (duplicate __name__ attributes of actions) should specify which
were duplicated.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: AdamDonna
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"8b3e714ecf409ed6c9628c3f2a4e033cbfa4253b" 8b3e714e]:
{{{
#!CommitTicketReference repository=""
revision="8b3e714ecf409ed6c9628c3f2a4e033cbfa4253b"
Fixed #30980 -- Improved error message when checking uniqueness of admin
actions' __name__.

Thanks Keshav Kumar for the initial patch.
}}}

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

Reply all
Reply to author
Forward
0 new messages