From 47b6255f682435329e63331b39535e4f50cbd4da Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 11 Aug 2022 07:22:22 +0100 Subject: [PATCH] Properly determine which fields to show --- core/views/ui/drilldown.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index 01df507..8d4ea2b 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -178,14 +178,7 @@ class DrilldownTableView(SingleTableView): def get(self, request, *args, **kwargs): self.object_list = self.get_queryset(request) show = [] - if len(self.object_list) > 0: - first = self.object_list[0] - fields = first.keys() - for field in fields: - # values_present = all([x[field] is not None for x in self.object_list]) - # if values_present: - if field not in show: - show.append(field) + show = set().union(*(d.keys() for d in self.object_list)) allow_empty = self.get_allow_empty() if not allow_empty: