doorcontrol: Improve performance of door access report views

This commit is contained in:
Adam Goldsmith 2023-11-29 21:31:29 -05:00
parent 72fa458f6e
commit 70691ff972

View File

@ -61,7 +61,10 @@ class BaseAccessReport(PermissionRequiredMixin, ListView):
def get_queryset(self):
return (
super().get_queryset().filter(timestamp__range=self._get_timestamp_range())
super()
.get_queryset()
.filter(timestamp__range=self._get_timestamp_range())
.select_related("door")
)
def get_context_data(self, **kwargs):