Statistics: Added a GET parameter to flush the cache

This commit is contained in:
Raphael Michel
2015-08-15 19:23:20 +02:00
parent 5d47abd36a
commit eb843be8b7

View File

@@ -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