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:
parent
7d10875213
commit
94f7481396
|
@ -343,7 +343,8 @@ Conditionally enabling or disabling actions
|
||||||
def get_actions(self, request):
|
def get_actions(self, request):
|
||||||
actions = super(MyModelAdmin, self).get_actions(request)
|
actions = super(MyModelAdmin, self).get_actions(request)
|
||||||
if request.user.username[0].upper() != 'J':
|
if request.user.username[0].upper() != 'J':
|
||||||
del actions['delete_selected']
|
if 'delete_selected' in actions:
|
||||||
|
del actions['delete_selected']
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue