﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29711	Add system check to ensure uniqueness of admin actions' __name__.	Przemysław Buczkowski	Przemysław Buczkowski	"It might be that I don't understand something, but I wrote this piece of code yesterday:

{{{
# admin.py
def action(fun):
    def immediately(modeladmin, request, queryset):
        result = fun(queryset)
        if result:
            modeladmin.message_user(request, result)
    immediately.short_description = fun.short_description + "" (now)""
    def queue(modeladmin, request, queryset):
        fun.delay(queryset)
        modeladmin.message_user(request, ""Added to the queue."")
    queue.short_description = fun.short_description + "" (add to the queue)""
    return immediately, queue

class CompanyAdmin(admin.ModelAdmin):
    actions = (*action(telephone), *action(mail))
# (...)
}}}

And only functions generated by the first call to action() get added. (In the case above two actions from ""telephone"" only; when reversed, from ""mail"" only).

I suspect that Django might detect them as duplicates."	Cleanup/optimization	closed	contrib.admin	dev	Normal	fixed			Accepted	1	0	0	1	0	0
