diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-12-21 14:56:48 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-12-21 14:56:48 +0000 |
| commit | 7655cd8eac4d745d791feb4349bbbcf69e892948 (patch) | |
| tree | 0944b4332a283f08abc6aeb87ba0d1c88ac89367 /django | |
| parent | e299ac0cae6623df3fe4c5fe26f2c1c3db8be1d6 (diff) | |
Fixed #13743 -- Fixed CommentsAdmin to not blow up if the delete_selected action is disabled. Thanks, Daniel Lindsley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/comments/admin.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/django/contrib/comments/admin.py b/django/contrib/comments/admin.py index 28678e045a..4cb90663a0 100644 --- a/django/contrib/comments/admin.py +++ b/django/contrib/comments/admin.py @@ -28,11 +28,13 @@ class CommentsAdmin(admin.ModelAdmin): def get_actions(self, request): actions = super(CommentsAdmin, self).get_actions(request) # Only superusers should be able to delete the comments from the DB. - if not request.user.is_superuser: + if not request.user.is_superuser and 'delete_selected' in actions: actions.pop('delete_selected') if not request.user.has_perm('comments.can_moderate'): - actions.pop('approve_comments') - actions.pop('remove_comments') + if 'approve_comments' in actions: + actions.pop('approve_comments') + if 'remove_comments' in actions: + actions.pop('remove_comments') return actions def flag_comments(self, request, queryset): |
