1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #15964 - Do not order admin actions by description

Thanks to julien for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant
2011-05-05 22:03:17 +00:00
parent d11acfd209
commit 8eccb728cc
3 changed files with 18 additions and 4 deletions

View File

@@ -341,13 +341,15 @@ def external_mail(modeladmin, request, selected):
'from@example.com',
['to@example.com']
).send()
external_mail.short_description = 'External mail (Another awesome action)'
def redirect_to(modeladmin, request, selected):
from django.http import HttpResponseRedirect
return HttpResponseRedirect('/some-where-else/')
redirect_to.short_description = 'Redirect to (Awesome action)'
class ExternalSubscriberAdmin(admin.ModelAdmin):
actions = [external_mail, redirect_to]
actions = [redirect_to, external_mail]
class Media(models.Model):
name = models.CharField(max_length=60)