silentsokolov / django-admin-rangefilter

A Django app that lets you filter data by date range and numeric range in the admin UI
MIT License
721 stars 106 forks source link

date range icon issue #5

Closed portergoh closed 7 years ago

portergoh commented 7 years ago

Date range from and to "choose a date" icon disappeared once we set admin.site.disable_action('delete_selected')

or override the following method in our custom admin class

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

Tested with Django version 1.10.4

silentsokolov commented 7 years ago

Sorry, I do not understand what you mean ... :(

portergoh commented 7 years ago

In the text box for from and to date range, there is a calendar picture link where you can choose a date. That picture link disappeared once you set the following to disable the delete_selected action

admin.site.disable_action('delete_selected')

silentsokolov commented 7 years ago

Fixed, thx