mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Statistics: Added a GET parameter to flush the cache
This commit is contained in:
@@ -9,6 +9,7 @@ from django.views.generic import TemplateView
|
||||
|
||||
from pretix.base.models import Item, Order, OrderPosition
|
||||
from pretix.control.permissions import EventPermissionRequiredMixin
|
||||
from pretix.plugins.statistics.signals import clear_cache
|
||||
|
||||
|
||||
class IndexView(EventPermissionRequiredMixin, TemplateView):
|
||||
@@ -18,6 +19,9 @@ class IndexView(EventPermissionRequiredMixin, TemplateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
|
||||
if 'latest' in self.request.GET:
|
||||
clear_cache()
|
||||
|
||||
cache = self.request.event.get_cache()
|
||||
|
||||
# Orders by day
|
||||
|
||||
Reference in New Issue
Block a user