fixed error on new overlay api

This commit is contained in:
Oskar Hahn 2013-04-15 15:47:18 +02:00
parent 1e389c25d8
commit f52df88cd6
2 changed files with 5 additions and 3 deletions

View File

@ -166,5 +166,7 @@ class Overlay(object):
return self.get_projector_html()
def is_active(self):
return (self.name in config['projector_active_overlays'] and
self.get_projector_html() is not None)
return self.name in config['projector_active_overlays']
def show_on_projector(self):
return self.is_active and self.get_projector_html() is not None

View File

@ -86,7 +86,7 @@ class Projector(TemplateView, AjaxMixin):
# Do not show overlays on slide preview
if self.kwargs['sid'] is None:
for receiver, overlay in projector_overlays.send(sender=self):
if overlay.is_active():
if overlay.show_on_projector():
data['overlays'].append({'name': overlay.name,
'html': overlay.get_projector_html()})