From a698a1b66bd83cab5112273a41b5888d09daa724 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Mon, 16 Jul 2018 18:35:01 +0200 Subject: [PATCH] Different way to get the changelist. --- src/documents/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/documents/admin.py b/src/documents/admin.py index 0c4904374..b4685434c 100755 --- a/src/documents/admin.py +++ b/src/documents/admin.py @@ -132,8 +132,10 @@ class DocumentAdmin(CommonAdmin): def changelist_view(self, request, extra_context=None): response = super().changelist_view(request, extra_context) - if 'cl' in response.context_data: - self.document_queue = [doc.id for doc in response.context_data['cl'].queryset] + + if request.method == 'GET': + cl = self.get_changelist_instance(request) + self.document_queue = [doc.id for doc in cl.queryset] return response