From ba75a340179b1a5405df8025d075cb0990a9f8bc Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Mon, 22 Apr 2013 22:09:09 +0200 Subject: [PATCH] Fixed list of speakers overlay cache problem --- openslides/agenda/signals.py | 4 +++- openslides/projector/signals.py | 2 ++ openslides/projector/views.py | 4 +--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openslides/agenda/signals.py b/openslides/agenda/signals.py index 59c1c2ddd..1633aebea 100644 --- a/openslides/agenda/signals.py +++ b/openslides/agenda/signals.py @@ -20,7 +20,8 @@ from openslides.config.api import ConfigVariable, ConfigPage from openslides.projector.signals import projector_overlays from openslides.projector.projector import Overlay -from openslides.projector.api import get_active_slide, get_slide_from_sid +from openslides.projector.api import (get_active_slide, get_slide_from_sid, + clear_projector_cache) from .models import Speaker, Item @@ -78,6 +79,7 @@ def agenda_list_of_speakers(sender, **kwargs): if not isinstance(slide, Item): # Only show list of speakers on Agenda-Items return None + clear_projector_cache() speakers = Speaker.objects.filter(time=None, item=slide)[:5] context = {'speakers': speakers} return render_to_string('agenda/overlay_speaker_projector.html', context) diff --git a/openslides/projector/signals.py b/openslides/projector/signals.py index 116972e77..672a0ed61 100644 --- a/openslides/projector/signals.py +++ b/openslides/projector/signals.py @@ -22,6 +22,7 @@ from openslides.config.signals import config_signal from openslides.config.api import ConfigVariable, ConfigPage from .projector import Overlay +from .api import clear_projector_cache projector_overlays = Signal(providing_args=['request']) @@ -116,6 +117,7 @@ def countdown(sender, **kwargs): seconds = 0 if seconds == 0: config['countdown_state'] = 'expired' + clear_projector_cache() return render_to_string('projector/overlay_countdown_projector.html', {'seconds': '%02d:%02d' % (seconds / 60, seconds % 60)}) diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 686692b9d..730a6fc33 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -121,9 +121,7 @@ class Projector(TemplateView, AjaxMixin): if not data: data = self.data cache.set('projector_data', data) - # clear cache if countdown is enabled - if config['countdown_state'] == 'active': - clear_projector_cache() + context = super(Projector, self).get_ajax_context(**kwargs) content_hash = hash(content) context.update({