I recently upgraded a large Django installation from 1.1 to 1.3. In the Comments application, they added a disclaimer, so only superusers receive the "Delete" action.
Moderators who have permission to delete do not see these actions as a result. This is really inconvenient for them.
This code is in the contrib.comments.admin file, starting at line 28:
def get_actions(self, request):
actions = super(CommentsAdmin, self).get_actions(request)
if not request.user.is_superuser and 'delete_selected' in actions:
actions.pop('delete_selected')
Instead, ask if request.user has permission to delete.
How can I override this without hacking with the actual Django installation?
(And if anyone knows why this was changed, I would be interested to know.)
source
share