#13743: CommentsAdmin blows up when 'delete_selected' action is disabled.
-------------------------------------+--------------------------------------
Reporter: daniellindsley | Owner: nobody
Status: new | Milestone:
Component: django.contrib.comments | Version: 1.2
Keywords: | Stage: Unreviewed
Has_patch: 1 |
-------------------------------------+--------------------------------------
In our admin, we disable the ``delete_selected`` action due to too many
users shooting themselves in the foot. We also have non-superuser accounts
that can access the admin.
The ``CommentsAdmin.get_actions`` method assumes various actions will be
in the list, but the ``actions.pop`` statements will fail as a result.
Attached is a traceback and a patch.
{{{
Traceback:
File "/home/code.django-1.0/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/home/code.django-1.0/django/contrib/admin/options.py" in wrapper
239. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/code.django-1.0/django/utils/decorators.py" in _wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/home/code.django-1.0/django/views/decorators/cache.py" in
_wrapped_view_func
69. response = view_func(request, *args, **kwargs)
File "/home/code.django-1.0/django/contrib/admin/sites.py" in inner
190. return view(request, *args, **kwargs)
File "/home/code.django-1.0/django/utils/decorators.py" in _wrapper
21. return decorator(bound_func)(*args, **kwargs)
File "/home/code.django-1.0/django/utils/decorators.py" in _wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/home/code.django-1.0/django/utils/decorators.py" in bound_func
17. return func(self, *args2, **kwargs2)
File "/home/code.django-1.0/django/contrib/admin/options.py" in
changelist_view
955. actions = self.get_actions(request)
File "/home/code.django-1.0/django/contrib/comments/admin.py" in
get_actions
32. actions.pop('delete_selected')
File "/home/code.django-1.0/django/utils/datastructures.py" in pop
123. result = super(SortedDict, self).pop(k, *args)
Exception Type: KeyError at /admin/comments/comment/
Exception Value: 'delete_selected'
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/13743>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.