Skip to content

Commit

Permalink
Globally disable delete_selected action in Admin. Fixes #221
Browse files Browse the repository at this point in the history
this removes the drop down selection widget!

NOTE: we could add a button in template's `object-tools` block
but that will not be able to handle multiple selection. Also the
checkboxes for multiple selection are not rendered when
delete_selected is disabled. For reference see:
sehmaschine/django-grappelli#839

If the user wants to delete an object they will have to open each
object in a separate page and delete it from there!
  • Loading branch information
atodorov committed Mar 7, 2018
1 parent 0d6f553 commit dcd1e55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tcms/core/admin.py
Expand Up @@ -37,3 +37,8 @@ class KiwiUserAdmin(UserAdmin):
# user admin extended functionality
admin.site.unregister(User)
admin.site.register(User, KiwiUserAdmin)

# globally disable the 'Delete selected' action
# see https://github.com/kiwitcms/Kiwi/issues/221 and
# https://docs.djangoproject.com/en/2.0/ref/contrib/admin/actions/#disabling-actions
admin.site.disable_action('delete_selected')

0 comments on commit dcd1e55

Please sign in to comment.