Remove the default delete action in Django admin

This works:

def get_actions(self, request):
    actions = super().get_actions(request)
    if 'delete_selected' in actions:
        del actions['delete_selected']
    return actions

It’s also the recommended way to do this based off Django’s documentation below:

Conditionally enabling or disabling actions

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)