Merge pull request #606 from ostcar/master
Fixed list of speakers overlay cache problem
This commit is contained in:
commit
150c4d6205
@ -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)
|
||||
|
@ -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)})
|
||||
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user