Skip to content

Commit

Permalink
admin: Don't override delete_selected action
Browse files Browse the repository at this point in the history
It's no longer necessary since 4edd116 and incompatible with Django 2.2 anyway.
  • Loading branch information
akx committed Apr 2, 2019
1 parent c21d602 commit 6041895
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions qsessions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ def queryset(self, request, queryset):
return queryset.filter(user=request.user)


def delete_selected(modeladmin, request, queryset):
for s in queryset.all():
s.delete()


delete_selected.short_description = _('Delete selected sessions')


@admin.register(Session)
class SessionAdmin(admin.ModelAdmin):
list_display = ('ip', 'user', 'is_valid', 'created_at', 'expire_date', 'device', 'location')
Expand All @@ -56,7 +48,6 @@ class SessionAdmin(admin.ModelAdmin):
fields = ('user', 'ip', 'location', 'is_valid', 'created_at', 'updated_at', 'expire_date',
'user_agent', 'device', 'session_key', 'session_data_decoded')
ordering = ('-expire_date', )
actions = [delete_selected]

def get_search_fields(self, request):
User = get_user_model()
Expand Down

0 comments on commit 6041895

Please sign in to comment.