statistics can load logs from archives

This commit is contained in:
bkfox
2020-05-31 20:07:37 +02:00
parent 4cda6d42e4
commit 09d0cab206
4 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,7 @@ from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView
from .log import LogListView
from ..models.log import LogArchiver
__all__ = ['BaseAdminView', 'StatisticsView']
@ -33,6 +34,8 @@ class StatisticsView(BaseAdminView, LogListView, ListView):
date = None
def get_object_list(self, logs, *_):
if not logs.exists():
logs = LogArchiver().load(self.station, self.date) if self.date else []
return super().get_object_list(logs, True)