Ticket #14450: actions.py.patch

File actions.py.patch, 952 bytes (added by Vsevolod Novikov, 14 years ago)

Patch for "Delete selected" action

  • actions.py

    old new  
    1212from django.utils.safestring import mark_safe
    1313from django.utils.text import capfirst
    1414from django.utils.translation import ugettext_lazy, ugettext as _
     15from django.conf import settings
    1516
    1617def delete_selected(modeladmin, request, queryset):
    1718    """
     
    2526    """
    2627    opts = modeladmin.model._meta
    2728    app_label = opts.app_label
     29    app_name = app_label.title()
     30    try:
     31        app_name = settings.APP_NAMES[app_label]
     32    except:
     33        pass
    2834
    2935    # Check that the user has delete permission for the actual model
    3036    if not modeladmin.has_delete_permission(request):
     
    6066        "opts": opts,
    6167        "root_path": modeladmin.admin_site.root_path,
    6268        "app_label": app_label,
     69        "app_name": app_name,
    6370        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
    6471    }
    6572
Back to Top