From 94f74813969911a540b7d6b15bd42891ed2bf237 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 29 Jul 2011 09:40:43 +0000 Subject: [PATCH] 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 --- docs/ref/contrib/admin/actions.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ref/contrib/admin/actions.txt b/docs/ref/contrib/admin/actions.txt index d3e9c74bad..cffdc3c21d 100644 --- a/docs/ref/contrib/admin/actions.txt +++ b/docs/ref/contrib/admin/actions.txt @@ -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