Ticket #13576: django_contrib_admin_actions-fix-perms-check-bug.diff

File django_contrib_admin_actions-fix-perms-check-bug.diff, 662 bytes (added by pelid80@…, 15 years ago)
  • actions.py

    old new def delete_selected(modeladmin, request,  
    2727    app_label = opts.app_label
    2828
    2929    # Check that the user has delete permission for the actual model
    30     if not modeladmin.has_delete_permission(request):
    31         raise PermissionDenied
     30    for obj in queryset:
     31        if not modeladmin.has_delete_permission(request, obj):
     32            raise PermissionDenied
    3233
    3334    # Populate deletable_objects, a data structure of all related objects that
    3435    # will also be deleted.
Back to Top