Fixed #16377 -- Fixed docs about how to disable the admin actions conditionally to match the current code. Thanks, Aymeric Augustin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-07-29 09:40:43 +00:00
parent 7d10875213
commit 94f7481396
1 changed files with 2 additions and 1 deletions

View File

@ -343,7 +343,8 @@ Conditionally enabling or disabling actions
def get_actions(self, request):
actions = super(MyModelAdmin, self).get_actions(request)
if request.user.username[0].upper() != 'J':
del actions['delete_selected']
if 'delete_selected' in actions:
del actions['delete_selected']
return actions