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.
* 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>
* status: new => assigned
* owner: nobody => KESHAV KUMAR
--
Ticket URL: <https://code.djangoproject.com/ticket/30980#comment:2>
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>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30980#comment:4>
Comment (by felixxm):
[https://github.com/django/django/pull/12281 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30980#comment:5>
* 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>
* 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>